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
effa06ec
Commit
effa06ec
authored
Aug 21, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up toku_ft_handle_close
parent
5a18a1b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
ft/ft-ops.cc
ft/ft-ops.cc
+14
-17
No files found.
ft/ft-ops.cc
View file @
effa06ec
...
@@ -3250,34 +3250,31 @@ ft_remove_handle_ref_callback(FT UU(ft), void *extra) {
...
@@ -3250,34 +3250,31 @@ ft_remove_handle_ref_callback(FT UU(ft), void *extra) {
toku_list_remove
(
&
handle
->
live_ft_handle_link
);
toku_list_remove
(
&
handle
->
live_ft_handle_link
);
}
}
// close an ft handle during normal operation. the underlying ft may or may not close,
static
void
ft_handle_close
(
FT_HANDLE
ft_handle
,
bool
oplsn_valid
,
LSN
oplsn
)
{
// depending if there are still references. an lsn for this close will come from the logger.
void
toku_ft_handle_close
(
FT_HANDLE
ft_handle
)
{
// There are error paths in the ft_handle_open that end with ft_handle->ft==NULL.
FT
ft
=
ft_handle
->
ft
;
FT
ft
=
ft_handle
->
ft
;
if
(
ft
)
{
// There are error paths in the ft_handle_open that end with ft_handle->ft == nullptr.
const
bool
oplsn_valid
=
false
;
if
(
ft
!=
nullptr
)
{
toku_ft_remove_reference
(
ft
,
oplsn_valid
,
ZERO_LSN
,
ft_remove_handle_ref_callback
,
ft_handle
);
toku_ft_remove_reference
(
ft
,
oplsn_valid
,
oplsn
,
ft_remove_handle_ref_callback
,
ft_handle
);
}
}
toku_free
(
ft_handle
);
toku_free
(
ft_handle
);
}
}
// close an ft handle during normal operation. the underlying ft may or may not close,
// depending if there are still references. an lsn for this close will come from the logger.
void
toku_ft_handle_close
(
FT_HANDLE
ft_handle
)
{
ft_handle_close
(
ft_handle
,
false
,
ZERO_LSN
);
}
// close an ft handle during recovery. the underlying ft must close, and will use the given lsn.
// close an ft handle during recovery. the underlying ft must close, and will use the given lsn.
void
void
toku_ft_handle_close_recovery
(
FT_HANDLE
ft_handle
,
LSN
oplsn
)
{
toku_ft_handle_close_recovery
(
FT_HANDLE
ft_handle
,
LSN
oplsn
)
{
FT
ft
=
ft_handle
->
ft
;
// the ft must exist if closing during recovery. error paths during
// the ft must exist if closing during recovery. error paths during
// open for recovery should close handles using toku_ft_handle_close()
// open for recovery should close handles using toku_ft_handle_close()
assert
(
ft
);
invariant_notnull
(
ft_handle
->
ft
);
const
bool
oplsn_valid
=
true
;
ft_handle_close
(
ft_handle
,
true
,
oplsn
);
toku_ft_remove_reference
(
ft
,
oplsn_valid
,
oplsn
,
ft_remove_handle_ref_callback
,
ft_handle
);
toku_free
(
ft_handle
);
}
}
// TODO: remove this, callers should instead just use toku_ft_handle_close()
// TODO: remove this, callers should instead just use toku_ft_handle_close()
int
int
toku_close_ft_handle_nolsn
(
FT_HANDLE
ft_handle
,
char
**
UU
(
error_string
))
{
toku_close_ft_handle_nolsn
(
FT_HANDLE
ft_handle
,
char
**
UU
(
error_string
))
{
toku_ft_handle_close
(
ft_handle
);
toku_ft_handle_close
(
ft_handle
);
return
0
;
return
0
;
}
}
...
...
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