History log of /freebsd-current/lib/libc/db/hash/hash.c
Revision Date Author Comments
# dc36d6f9 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 559a218c 01-Nov-2023 Warner Losh <imp@FreeBSD.org>

libc: Purge unneeded cdefs.h

These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Keep those.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D42385


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 968c0b40 25-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

libc: make more use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.


# 513004a2 10-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

libc: replace 0 with NULL for pointers.

While here also cleanup some surrounding code; particularly
drop some malloc() casts.

Found with devel/coccinelle.

Reviewed by: bde (previous version - all new bugs are mine)


# 15719ec4 06-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r295924: Only sync hash-based db files open for writing when closing.

This fixes a major performance regression when reading db files such as
the pw database during a 'pkg install'.

MFC after: 1 week
Tested by: bapt
Reviewed by: bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5868


# efb7dae2 23-Feb-2016 David Malone <dwmalone@FreeBSD.org>

If we close or sync a hash-based db file, make sure to call fsync to
make sure the changes are on disk. The people at pfSense noticed that
it didn't always make it to the disk soon enough with soft updates.

Differential Revision: https://reviews.freebsd.org/D5186
Reviewed by: garga, vangyzen, bapt, se
MFC after: 1 week


# 1b81d865 18-May-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

Drop some unnecessary casts.

Reported by: Clang static analyzer
Obtained from: NetBSD


# 46d71747 11-Aug-2013 Jilles Tjoelker <jilles@FreeBSD.org>

db/hash: Use O_CLOEXEC instead of separate fcntl() call.

In particular, a hash db is used by getpwnam() and getpwuid().

MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d1bec90b 12-Apr-2010 Andriy Gapon <avg@FreeBSD.org>

MFC r206178: ibc/db/hash: cap auto-tuned block size


# f3c733e8 05-Apr-2010 Andriy Gapon <avg@FreeBSD.org>

libc/db/hash: cap auto-tuned block size with a value that actually works

This fix mostly matters after r206129 that made it possible for
st_blksize to be greater than 4K. For this reason, this change should
be MFC-ed before r206129.
Also, it seems that all FreeBSD uitlities that use db(3) hash databases
and create new databases in files, specify their own block size value
and thus do not depend on block size autotuning.

PR: bin/144446
Submitted by: Peter Jeremy <peterjeremy@acm.org>
MFC after: 5 days


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# c291f85f 28-Aug-2009 Xin LI <delphij@FreeBSD.org>

MFC r196525:

Consider flag == 0 as the same of flag == R_NEXT. This change will restore
a historical behavior that has been changed by revision 190491, and has seen
to break exim.

Approved by: re (kib)


# 4f0d3f44 24-Aug-2009 Xin LI <delphij@FreeBSD.org>

Consider flag == 0 as the same of flag == R_NEXT. This change will restore
a historical behavior that has been changed by revision 190491, and has seen
to break exim.


# 6c90d46e 28-Mar-2009 Xin LI <delphij@FreeBSD.org>

Plug memory leaks and a potential NULL dereference.

Obtained from: OpenBSD


# edcdc752 28-Mar-2009 Xin LI <delphij@FreeBSD.org>

Simplify the logic when determining whether to zero out a db file to after
open(). The previous logic only initializes the database when O_CREAT is
set, but as long as we can open and write the database, and the database
is empty, we should initialize it anyway.

Obtained from: OpenBSD


# 213bceee 28-Mar-2009 Xin LI <delphij@FreeBSD.org>

Fix a crash when iterating over a hash and removing its elements.

Obtained from: OpenBSD


# b115f257 28-Mar-2009 Xin LI <delphij@FreeBSD.org>

Diff reduce against OpenBSD, no functional change.


# d3b2afad 28-Mar-2009 Xin LI <delphij@FreeBSD.org>

Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).

Obtained from: NetBSD via OpenBSD


# f60486b3 27-Mar-2009 Xin LI <delphij@FreeBSD.org>

Several signed/unsigned warning fixes.


# 0ac22237 02-Mar-2009 Xin LI <delphij@FreeBSD.org>

Diff reduction against OpenBSD: ANSI'fy prototypes.

(This is part of a larger changeset which is intended to reduce diff only,
thus some prototypes were left intact since they will be changed in the
future).

Verified with: md5(1)


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# f22d3eb4 25-May-2007 Xin LI <delphij@FreeBSD.org>

The usage of "info" in init_hash() is read-only, so constify
the internal interface instead of casting away the constant
constraint upon calling.


# c879ae35 08-Jan-2007 Warner Losh <imp@FreeBSD.org>

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


# 312f1851 09-Sep-2004 Jun Kuriyama <kuriyama@FreeBSD.org>

Fix format strings to unbreak with -DDEBUG option.


# c05ac53b 21-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove __P() usage.


# 8fb3f3f6 21-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove 'register' keyword.


# d201fe46 24-Jan-2001 Daniel Eischen <deischen@FreeBSD.org>

Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions. If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
__sys_foo - actual system call
_foo - weak definition to __sys_foo
foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo. In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde). All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes. <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE. We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by: -arch


# 9233c4d9 27-Jan-2000 Jason Evans <jasone@FreeBSD.org>

Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate. In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by: deischen


# 92927338 12-Jan-2000 Jason Evans <jasone@FreeBSD.org>

Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().


# 51295a4d 12-Jul-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>


# f1e396bc 27-Feb-1996 Paul Traina <pst@FreeBSD.org>

Fix conflicts and merge into mainline


# 1f70cace 24-Feb-1996 Paul Traina <pst@FreeBSD.org>

move stat behind open to cover corner case


# f0113fc0 23-Feb-1996 Paul Traina <pst@FreeBSD.org>

If a .db file is 0 length, initialize it as if it did not exist.
Reviewed by: wollman


# f70177e7 21-Jan-1996 Julian Elischer <julian@FreeBSD.org>

Reviewed by: julian and (hsu?)
Submitted by: John Birrel(L?)

changes for threadsafe operations


# 58f0484f 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Lib Sources