summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_hash.c
Commit message (Collapse)AuthorAgeFilesLines
* Add vfs_hash_ref(9) function, which finds a vnode by the hash valuekib2016-05-111-0/+30
| | | | | | | | | | | | and returns it referenced. The function is similar to vfs_hash_get(9), but unlike the later, returned vnode is not locked. This operation cannot be requested with the vget(9) flags. Reviewed and tested by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Style: wrap long lines.kib2016-05-111-2/+4
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Track changes to kern.maxvnodes and appropriately increase or decreasemckusick2015-09-061-0/+37
| | | | | | | | | | | | the size of the name cache hash table (mapping file names to vnodes) and the vnode hash table (mapping mount point and inode number to vnode). An appropriate locking strategy is the key to changing hash table sizes while they are in active use. Reviewed by: kib Tested by: Peter Holm Differential Revision: https://reviews.freebsd.org/D2265 MFC after: 2 weeks
* vfs: implement v_holdcnt/v_usecount manipulation using atomic opsmjg2015-07-161-4/+4
| | | | | | | | Transitions 0->1 and 1->0 (which decide e.g. on putting the vnode on the free list) of either counter are still guarded with vnode interlock. Reviewed by: kib (earlier version) Tested by: pho
* Convert vfs hash lock from a mutex to an rwlock.mjg2014-12-301-14/+15
|
* Add exported vfs_hash_index() function, which calculates the canonicalkib2013-01-141-0/+7
| | | | | | | | | | | | pre-masked hash for the given vnode. The function assumes that vp->v_hash is initialized by the filesystem vnode instantiation function. At the moment, it is only done if filesystem uses vfs_hash_insert(). Reviewed by: peter Tested by: peter, pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 5 days
* Rename vfs_hash_index() to vfs_hash_bucket().kib2013-01-141-6/+6
| | | | | | | Reviewed by: peter Tested by: peter, pho Sponsored by: The FreeBSD Foundation MFC after: 5 days
* In keeping with style(9)'s recommendations on macros, use a ';'rwatson2008-03-161-1/+1
| | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink
* Make insmntque() externally visibile and allow it to fail (e.g. duringtegge2007-03-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | late stages of unmount). On failure, the vnode is recycled. Add insmntque1(), to allow for file system specific cleanup when recycling vnode on failure. Change getnewvnode() to no longer call insmntque(). Previously, embryonic vnodes were put onto the list of vnode belonging to a file system, which is unsafe for a file system marked MPSAFE. Change vfs_hash_insert() to no longer lock the vnode. The caller now has that responsibility. Change most file systems to lock the vnode and call insmntque() or insmntque1() after a new vnode has been sufficiently setup. Handle failed insmntque*() calls by propagating errors to callers, possibly after some file system specific cleanup. Approved by: re (kensmith) Reviewed by: kib In collaboration with: kib
* In vfs_hash_get(): mount point should never be changeddelphij2006-04-181-2/+2
| | | | | | so explicitly constify the mp parameter. Reviewed by: phk
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* Don't retry when vget() returns ENOENT in the nonblocking case due to thetegge2005-09-121-2/+2
| | | | vnode being doomed. It causes a livelock.
* Fix bug in vfs_hash_rehash(): use correct bucket. This only affectedphk2005-04-071-1/+1
| | | | msdosfs which is broken in other ways too.
* - Grab the lock type that the caller requests in vfs_hash_insert().jeff2005-03-241-1/+1
| | | | Sponsored by: Isilon Systems, Inc.
* Fix a bad copy&paste mistake I made.phk2005-03-181-1/+1
| | | | Spotted by: truckman
* Add two arguments to the vfs_hash() KPI so that filesystems which dophk2005-03-161-2/+6
| | | | not have unique hashes (NFS) can also use it.
* Add mnt_hashseed to struct mount and initialize it witn PRNG bits, usephk2005-03-161-15/+17
| | | | | | | | | | it to get better hashing in vfs_hash. In case of an insert collision in vfs_hash_insert(), put the loosing vnode on a special list so that vfs_hash_remove() can just assume that it is on a list. Drop the VI_HASHED flag.
* Improve the vfs_hash() API: vput() the unneeded vnode centrally tophk2005-03-151-4/+4
| | | | avoid replicating the vput in all the filesystems.
* Simplify the vfs_hash calling convention.phk2005-03-151-1/+2
|
* Cleanup accidentally include #if 0 section.phk2005-03-141-35/+0
|
* Currently (almost) all filesystems maintain a local inode hash tablephk2005-03-141-0/+184
to get from (mount + inode) to vnode. These tables are mostly copy&pasted from UFS, sized based on desiredvnodes and therefore quite large (128K-512K). Several filesystems are buggy enough that they allocate the hash table even before they know if they will ever be used or not. Add "vfs_hash", a system wide hash table, which will replace all the per-filesystem hash-tables. The fields we add to struct vnode will more or less be saved in the respective filesystems inodes. Having one central implementation will save code and will allow us to justify the complexity of code to dynamically (re)size the hash at a later point.
OpenPOWER on IntegriCloud