Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
f7b3eb1e
Commit
f7b3eb1e
authored
Feb 04, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdb: use TDB_RECOVERY_INVALID_MAGIC rather than 0
parent
5ebc1701
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
ccan/tdb/check.c
ccan/tdb/check.c
+1
-1
ccan/tdb/tdb_private.h
ccan/tdb/tdb_private.h
+1
-0
ccan/tdb/transaction.c
ccan/tdb/transaction.c
+3
-3
No files found.
ccan/tdb/check.c
View file @
f7b3eb1e
...
...
@@ -370,7 +370,7 @@ int tdb_check(struct tdb_context *tdb,
goto
free
;
break
;
case
TDB_RECOVERY_MAGIC
:
case
0
:
/* Used for invalid (or in-progress) recovery area. */
case
TDB_RECOVERY_INVALID_MAGIC
:
if
(
recovery_start
!=
off
)
{
TDB_LOG
((
tdb
,
TDB_DEBUG_ERROR
,
"Unexpected recovery record at offset %d
\n
"
,
...
...
ccan/tdb/tdb_private.h
View file @
f7b3eb1e
...
...
@@ -69,6 +69,7 @@ typedef uint32_t tdb_off_t;
#define TDB_FREE_MAGIC (~TDB_MAGIC)
#define TDB_DEAD_MAGIC (0xFEE1DEAD)
#define TDB_RECOVERY_MAGIC (0xf53bc0e7U)
#define TDB_RECOVERY_INVALID_MAGIC (0x0)
#define TDB_ALIGNMENT 4
#define DEFAULT_HASH_SIZE 131
#define FREELIST_TOP (sizeof(struct tdb_header))
...
...
ccan/tdb/transaction.c
View file @
f7b3eb1e
...
...
@@ -494,10 +494,10 @@ int _tdb_transaction_cancel(struct tdb_context *tdb, int ltype)
if
(
tdb
->
transaction
->
magic_offset
)
{
const
struct
tdb_methods
*
methods
=
tdb
->
transaction
->
io_methods
;
uint32_t
zero
=
0
;
uint32_t
invalid
=
TDB_RECOVERY_INVALID_MAGIC
;
/* remove the recovery marker */
if
(
methods
->
tdb_write
(
tdb
,
tdb
->
transaction
->
magic_offset
,
&
zero
,
4
)
==
-
1
||
if
(
methods
->
tdb_write
(
tdb
,
tdb
->
transaction
->
magic_offset
,
&
invalid
,
4
)
==
-
1
||
transaction_sync
(
tdb
,
tdb
->
transaction
->
magic_offset
,
4
)
==
-
1
)
{
TDB_LOG
((
tdb
,
TDB_DEBUG_FATAL
,
"tdb_transaction_cancel: failed to remove recovery magic
\n
"
));
ret
=
-
1
;
...
...
@@ -805,7 +805,7 @@ static int transaction_setup_recovery(struct tdb_context *tdb,
rec
=
(
struct
tdb_record
*
)
data
;
memset
(
rec
,
0
,
sizeof
(
*
rec
));
rec
->
magic
=
0
;
rec
->
magic
=
TDB_RECOVERY_INVALID_MAGIC
;
rec
->
data_len
=
recovery_size
;
rec
->
rec_len
=
recovery_max_size
;
rec
->
key_len
=
old_map_size
;
...
...
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