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
0aa58f6e
Commit
0aa58f6e
authored
Mar 01, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdb2: remove extraneous whitespace.
Gets us one extra ccanlint point, too.
parent
a2083afe
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
34 deletions
+34
-34
ccan/tdb2/check.c
ccan/tdb2/check.c
+4
-4
ccan/tdb2/free.c
ccan/tdb2/free.c
+2
-2
ccan/tdb2/hash.c
ccan/tdb2/hash.c
+6
-6
ccan/tdb2/io.c
ccan/tdb2/io.c
+4
-4
ccan/tdb2/lock.c
ccan/tdb2/lock.c
+4
-4
ccan/tdb2/private.h
ccan/tdb2/private.h
+3
-3
ccan/tdb2/summary.c
ccan/tdb2/summary.c
+2
-2
ccan/tdb2/tdb2.h
ccan/tdb2/tdb2.h
+5
-5
ccan/tdb2/traverse.c
ccan/tdb2/traverse.c
+4
-4
No files found.
ccan/tdb2/check.c
View file @
0aa58f6e
/*
/*
Trivial Database 2: free list/block handling
Copyright (C) Rusty Russell 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
...
...
@@ -277,7 +277,7 @@ static bool check_hash_tree(struct tdb_context *tdb,
if
(
is_subhash
(
group
[
b
]))
{
uint64_t
subprefix
;
subprefix
=
(
hprefix
subprefix
=
(
hprefix
<<
(
group_bits
+
TDB_HASH_GROUP_BITS
))
+
g
*
(
1
<<
TDB_HASH_GROUP_BITS
)
+
b
;
...
...
@@ -449,7 +449,7 @@ static bool check_free(struct tdb_context *tdb,
}
return
true
;
}
static
bool
check_free_table
(
struct
tdb_context
*
tdb
,
tdb_off_t
ftable_off
,
unsigned
ftable_num
,
...
...
ccan/tdb2/free.c
View file @
0aa58f6e
/*
/*
Trivial Database 2: free list/block handling
Copyright (C) Rusty Russell 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
...
...
ccan/tdb2/hash.c
View file @
0aa58f6e
/*
/*
Trivial Database 2: hash handling
Copyright (C) Rusty Russell 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
...
...
@@ -245,7 +245,7 @@ tdb_off_t find_and_lock(struct tdb_context *tdb,
tinfo
->
toplevel_group
=
group
;
tinfo
->
num_levels
=
1
;
tinfo
->
levels
[
0
].
entry
=
0
;
tinfo
->
levels
[
0
].
hashtable
=
hashtable
tinfo
->
levels
[
0
].
hashtable
=
hashtable
+
(
group
<<
TDB_HASH_GROUP_BITS
)
*
sizeof
(
tdb_off_t
);
tinfo
->
levels
[
0
].
total_buckets
=
1
<<
TDB_HASH_GROUP_BITS
;
}
...
...
@@ -384,7 +384,7 @@ static tdb_off_t encode_offset(tdb_off_t new_off, struct hash_info *h)
<<
TDB_OFF_HASH_EXTRA_BIT
);
}
/* Simply overwrite the hash entry we found before. */
/* Simply overwrite the hash entry we found before. */
int
replace_in_hash
(
struct
tdb_context
*
tdb
,
struct
hash_info
*
h
,
tdb_off_t
new_off
)
...
...
@@ -716,12 +716,12 @@ int next_in_hash(struct tdb_context *tdb, int ltype,
/* They want data as well? */
if
(
dlen
)
{
*
dlen
=
rec_data_length
(
&
rec
);
kbuf
->
dptr
=
tdb_alloc_read
(
tdb
,
kbuf
->
dptr
=
tdb_alloc_read
(
tdb
,
off
+
sizeof
(
rec
),
kbuf
->
dsize
+
*
dlen
);
}
else
{
kbuf
->
dptr
=
tdb_alloc_read
(
tdb
,
kbuf
->
dptr
=
tdb_alloc_read
(
tdb
,
off
+
sizeof
(
rec
),
kbuf
->
dsize
);
}
...
...
ccan/tdb2/io.c
View file @
0aa58f6e
/*
/*
Unix SMB/CIFS implementation.
trivial database library
...
...
@@ -64,7 +64,7 @@ void tdb_mmap(struct tdb_context *tdb)
/* check for an out of bounds access - if it is out of bounds then
see if the database has been expanded by someone else and expand
if necessary
if necessary
note that "len" is the minimum length needed for the db
*/
static
int
tdb_oob
(
struct
tdb_context
*
tdb
,
tdb_off_t
len
,
bool
probe
)
...
...
@@ -207,7 +207,7 @@ tdb_off_t tdb_read_off(struct tdb_context *tdb, tdb_off_t off)
}
/* write a lump of data at a specified offset */
static
int
tdb_write
(
struct
tdb_context
*
tdb
,
tdb_off_t
off
,
static
int
tdb_write
(
struct
tdb_context
*
tdb
,
tdb_off_t
off
,
const
void
*
buf
,
tdb_len_t
len
)
{
if
(
tdb
->
read_only
)
{
...
...
@@ -411,7 +411,7 @@ static int tdb_expand_file(struct tdb_context *tdb, tdb_len_t addition)
const
void
*
tdb_access_read
(
struct
tdb_context
*
tdb
,
tdb_off_t
off
,
tdb_len_t
len
,
bool
convert
)
{
const
void
*
ret
=
NULL
;
const
void
*
ret
=
NULL
;
if
(
likely
(
!
(
tdb
->
flags
&
TDB_CONVERT
)))
ret
=
tdb
->
methods
->
direct
(
tdb
,
off
,
len
,
false
);
...
...
ccan/tdb2/lock.c
View file @
0aa58f6e
/*
/*
Unix SMB/CIFS implementation.
trivial database library
...
...
@@ -198,7 +198,7 @@ static int tdb_brunlock(struct tdb_context *tdb,
upgrade a read lock to a write lock. This needs to be handled in a
special way as some OSes (such as solaris) have too conservative
deadlock detection and claim a deadlock when progress can be
made. For those OSes we may loop for a while.
made. For those OSes we may loop for a while.
*/
int
tdb_allrecord_upgrade
(
struct
tdb_context
*
tdb
)
{
...
...
@@ -502,7 +502,7 @@ again:
tdb_logerr
(
tdb
,
tdb
->
ecode
,
TDB_DEBUG_ERROR
,
"tdb_allrecord_lock freetables failed"
);
}
tdb_brunlock
(
tdb
,
ltype
,
TDB_HASH_LOCK_START
,
tdb_brunlock
(
tdb
,
ltype
,
TDB_HASH_LOCK_START
,
TDB_HASH_LOCK_RANGE
);
return
-
1
;
}
...
...
@@ -518,7 +518,7 @@ again:
tdb_allrecord_unlock
(
tdb
,
ltype
);
if
(
tdb_lock_and_recover
(
tdb
)
==
-
1
)
{
return
-
1
;
}
}
goto
again
;
}
...
...
ccan/tdb2/private.h
View file @
0aa58f6e
#ifndef TDB_PRIVATE_H
#define TDB_PRIVATE_H
/*
/*
Trivial Database 2: private types and prototypes
Copyright (C) Rusty Russell 2010
...
...
@@ -325,7 +325,7 @@ struct tdb_context {
int
mmap_flags
;
/* Error code for last tdb error. */
enum
TDB_ERROR
ecode
;
enum
TDB_ERROR
ecode
;
/* the flags passed to tdb_open, for tdb_reopen. */
uint32_t
flags
;
...
...
@@ -361,7 +361,7 @@ struct tdb_context {
/* Single list of all TDBs, to avoid multiple opens. */
struct
tdb_context
*
next
;
dev_t
device
;
dev_t
device
;
ino_t
inode
;
};
...
...
ccan/tdb2/summary.c
View file @
0aa58f6e
/*
/*
Trivial Database 2: human-readable summary code
Copyright (C) Rusty Russell 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
...
...
ccan/tdb2/tdb2.h
View file @
0aa58f6e
#ifndef CCAN_TDB2_H
#define CCAN_TDB2_H
/*
/*
Unix SMB/CIFS implementation.
trivial database library
Copyright (C) Andrew Tridgell 1999-2004
** NOTE! The following LGPL license applies to the tdb
** library. This does NOT imply that all of Samba is released
** under the LGPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
...
...
@@ -60,7 +60,7 @@ extern "C" {
#define TDB_ALLOW_NESTING 512
/* Allow transactions to nest */
/* error codes */
enum
TDB_ERROR
{
TDB_SUCCESS
=
0
,
TDB_ERR_CORRUPT
,
TDB_ERR_IO
,
TDB_ERR_LOCK
,
enum
TDB_ERROR
{
TDB_SUCCESS
=
0
,
TDB_ERR_CORRUPT
,
TDB_ERR_IO
,
TDB_ERR_LOCK
,
TDB_ERR_OOM
,
TDB_ERR_EXISTS
,
TDB_ERR_NOEXIST
,
TDB_ERR_EINVAL
,
TDB_ERR_RDONLY
,
TDB_ERR_NESTING
};
...
...
@@ -68,7 +68,7 @@ enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
enum
tdb_summary_flags
{
TDB_SUMMARY_HISTOGRAMS
=
1
};
/* logging uses one of the following levels */
enum
tdb_debug_level
{
TDB_DEBUG_FATAL
=
0
,
TDB_DEBUG_ERROR
,
enum
tdb_debug_level
{
TDB_DEBUG_FATAL
=
0
,
TDB_DEBUG_ERROR
,
TDB_DEBUG_WARNING
,
TDB_DEBUG_TRACE
};
typedef
struct
tdb_data
{
...
...
ccan/tdb2/traverse.c
View file @
0aa58f6e
/*
/*
Trivial Database 2: traverse function.
Copyright (C) Rusty Russell 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
...
...
@@ -74,7 +74,7 @@ TDB_DATA tdb_firstkey(struct tdb_context *tdb)
default:
return
tdb_null
;
}
}
}
/* We lock twice, not very efficient. We could keep last key & tinfo cached. */
TDB_DATA
tdb_nextkey
(
struct
tdb_context
*
tdb
,
TDB_DATA
key
)
...
...
@@ -97,4 +97,4 @@ TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key)
default:
return
tdb_null
;
}
}
}
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