summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_init.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove VFS_START(). Its original purpose involved the mfs filesystem,David Schultz2005-02-201-3/+0
| | | | | | | | | | which is long gone. Discussed with: mckusick Reviewed by: phk Notes: svn path=/head/; revision=142153
* Make various mountpoint related functions static.Poul-Henning Kamp2005-02-101-2/+4
| | | | Notes: svn path=/head/; revision=141634
* Change the generated VOP_ macro implementations to improve type checkingPoul-Henning Kamp2005-01-131-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and KASSERT coverage. After this check there is only one "nasty" cast in this code but there is a KASSERT to protect against the wrong argument structure behind that cast. Un-inlining the meat of VOP_FOO() saves 35kB of text segment on a typical kernel with no change in performance. We also now run the checking and tracing on VOP's which have been layered by nullfs, umapfs, deadfs or unionfs. Add new (non-inline) VOP_FOO_AP() functions which take a "struct foo_args" argument and does everything the VOP_FOO() macros used to do with checks and debugging code. Add KASSERT to VOP_FOO_AP() check for argument type being correct. Slim down VOP_FOO() inline functions to just stuff arguments into the struct foo_args and call VOP_FOO_AP(). Put function pointer to VOP_FOO_AP() into vop_foo_desc structure and make VCALL() use it instead of the current offsetoff() hack. Retire vcall() which implemented the offsetoff() Make deadfs and unionfs use VOP_FOO_AP() calls instead of VCALL(), we know which specific call we want already. Remove unneeded arguments to VCALL() in nullfs and umapfs bypass functions. Remove unused vdesc_offset and VOFFSET(). Generally improve style/readability of the generated code. Notes: svn path=/head/; revision=140165
* /* -> /*- for copyright notices, minor format tweaks as necessaryWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139804
* The remaining part of nmount/omount/rootfs mount changes. I cannot sensiblyPoul-Henning Kamp2004-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | split the conversion of the remaining three filesystems out from the root mounting changes, so in one go: cd9660: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() nfs(client): Convert to nmount (the simple way, mount_nfs(8) is still necessary). Add omount compat shims. Drop COMPAT_PRELITE2 mount arg compatibility. ffs: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() Remove vfs_omount() method, all filesystems are now converted. Remove MNTK_WANTRDWR, handling RO/RW conversions is a filesystem task, and they all do it now. Change rootmounting to use DEVFS trampoline: vfs_mount.c: Mount devfs on /. Devfs needs no 'from' so this is clean. symlink /dev to /. This makes it possible to lookup /dev/foo. Mount "real" root filesystem on /. Surgically move the devfs mountpoint from under the real root filesystem onto /dev in the real root filesystem. Remove now unnecessary getdiskbyname(). kern_init.c: Don't do devfs mounting and rootvnode assignment here, it was already handled by vfs_mount.c. Remove now unused bdevvp(), addaliasu() and addalias(). Put the few necessary lines in devfs where they belong. This eliminates the second-last source of bogo vnodes, leaving only the lemming-syncer. Remove rootdev variable, it doesn't give meaning in a global context and was not trustworth anyway. Correct information is provided by statfs(/). Notes: svn path=/head/; revision=138509
* make "ffs" and alias for "ufs" when it comes to filesystem names.Poul-Henning Kamp2004-12-061-0/+2
| | | | Notes: svn path=/head/; revision=138497
* Introduce vfs_byname_kld() which will try to load the filesystemPoul-Henning Kamp2004-12-031-0/+37
| | | | | | | | | | as a module if possible. Use it so we don't have linker magic in the middle of the already complex mount code. Notes: svn path=/head/; revision=138350
* Back when VOP_* was introduced, we did not have new-style structPoul-Henning Kamp2004-12-011-263/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts) Notes: svn path=/head/; revision=138290
* Simplify initialization of va_null a little bit.Poul-Henning Kamp2004-09-151-13/+13
| | | | Notes: svn path=/head/; revision=135279
* Put a version element in the VFS filesystem configuration structurePoul-Henning Kamp2004-07-301-2/+7
| | | | | | | | | | | | | | | | | | | | | and refuse initializing filesystems with a wrong version. This will aid maintenance activites on the 5-stable branch. s/vfs_mount/vfs_omount/ s/vfs_nmount/vfs_mount/ Name our filesystems mount function consistently. Eliminate the namiedata argument to both vfs_mount and vfs_omount. It was originally there to save stack space. A few places abused it to get hold of some credentials to pass around. Effectively it is unused. Reorganize the root filesystem selection code. Notes: svn path=/head/; revision=132902
* Convert the vfsconf list to a TAILQ.Poul-Henning Kamp2004-07-271-25/+19
| | | | | | | | | | | Introduce vfs_byname() function to find things on it. Staticize vfs_nmount() function under the name vfs_donmount(). Various cleanups. Notes: svn path=/head/; revision=132710
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPPoul-Henning Kamp2004-07-151-1/+2
| | | | | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything". Notes: svn path=/head/; revision=132199
* do the vfsstd thing instead of messing up our VFS_SYSCTL macro.Alfred Perlstein2004-07-071-0/+2
| | | | Notes: svn path=/head/; revision=131733
* Remove advertising clause from University of California Regent's license,Warner Losh2004-04-051-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core Notes: svn path=/head/; revision=127911
* Remove opv_desc_vector from vfs_add_vnodeops, since it is definedColin Percival2004-02-151-2/+0
| | | | | | | | | | | and given a value, but never used. This has no effect on the resulting binaries, since gcc optimizes the variable away anyway. PR: kern/62684 Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125847
* Change all SYSCTLS which are readonly and have a related TUNABLEMike Silbersack2003-10-211-1/+1
| | | | | | | | from CTLFLAG_RD to CTLFLAG_RDTUN so that sysctl(8) can provide more useful error messages. Notes: svn path=/head/; revision=121307
* Initialize struct vfsops C99-sparsely.Poul-Henning Kamp2003-06-121-0/+61
| | | | | | | | Submitted by: hmp Reviewed by: phk Notes: svn path=/head/; revision=116271
* Use __FBSDID().David E. O'Brien2003-06-111-1/+2
| | | | Notes: svn path=/head/; revision=116182
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-8/+8
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-8/+8
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* We don't need to check the return value of malloc() againstMaxime Henrion2002-06-221-14/+0
| | | | | | | NULL when the M_WAITOK flag is specified. Notes: svn path=/head/; revision=98641
* More s/file system/filesystem/gTom Rhodes2002-05-161-4/+4
| | | | Notes: svn path=/head/; revision=96755
* These are Alexander Kabaev's VFSops fixes (see the thread 'Found: moduleMatthew Dillon2002-04-301-21/+82
| | | | | | | | | | | | | | | | | | | | loading breakage'). The patch fixes serious issues with the VFS operations vector array which results in a crash when a filesystem module adding a new VOP is loaded into the kernel. Basically what was happening before was that the old operations vector was being freed and a new one allocated. The original MALLOC code tended to reuse the same address for the case and so the bug did not rear its ugly head until the new memory subsystem was emplaced. This patch replaces the temporary workaround Dave O'Brien comitted in 1.58. The patch is clean enough that I intend to MFC it to stable at some point. Submitted by: Alexander Kabaev <ak03@gte.com> MFC after: 1 week Notes: svn path=/head/; revision=95813
* Commit work-around for panics when mounting FS's that are auto-loaded asDavid E. O'Brien2002-03-251-0/+2
| | | | | | | | | | | | | | | | | | modules (ie. procfs.ko). When the kernel loads dynamic filesystem module, it looks for any of the VOP operations specified by the new filesystem that have not been registered already by the currently known filesystems. If any of such operations exist, vfs_add_vnops function calls vfs_opv_recalc function, which rebuilds vop_t vectors for each filesystem and sets all global pointers like ufs_vnops_p, devfs_specop_p, etc to the new values and then frees the old pointers. This behavior is bad because there might be already active vnodes whose v_op fields will be left pointing to the random garbage, leading to inevitable crash soon. Submitted by: Alexander Kabaev <ak03@gte.com> Notes: svn path=/head/; revision=93170
* Remove references to vm_zone.h and switch over to the new uma API.Jeff Roberson2002-03-201-1/+0
| | | | | | | | Also, remove maxsockets. If you look carefully you'll notice that the old zone allocator never honored this anyway. Notes: svn path=/head/; revision=92751
* Document all functions, global and static variables, and sysctls.Eivind Eklund2002-03-051-1/+23
| | | | | | | | | | | Includes some minor whitespace changes, and re-ordering to be able to document properly (e.g, grouping of variables and the SYSCTL macro calls for them, where the documentation has been added.) Reviewed by: phk (but all errors are mine) Notes: svn path=/head/; revision=91690
* Revert consequences of changes to mount.h, part 2.Greg Lehey2001-04-291-2/+0
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=76117
* Correct #includes to work with fixed sys/mount.h.Greg Lehey2001-04-231-0/+2
| | | | Notes: svn path=/head/; revision=75858
* Another round of the <sys/queue.h> FOREACH transmogriffer.Poul-Henning Kamp2001-02-041-2/+1
| | | | | | | | Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=72012
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-2/+2
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Untangle vfsinit() a bit. Use seperate sysinit functions rather thanPeter Wemm2000-12-061-23/+2
| | | | | | | having a super-function calling bits all over the place. Notes: svn path=/head/; revision=69664
* Do not panic on an uninitialized VOP_xxx() call. This was meant as aPeter Wemm2000-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | sanity check, but it is too easy to run into, eg: making an ACL syscall when no filesystems have the ACL implementation enabled. The original reason for the panic was that the VOP_ vector had not been assigned and therefor could not be passed down the stack.. and there was no point passing it down since nothing implemented it anyway. vop_defaultop entries could not pass it on because it had a zero (unknown) vector that was indistinguishable from another unknown VOP vector. Anyway, we can do something reasonable in this case, we shouldn't need to panic here as there is a reasonable recovery option (return EOPNOTSUPP and dont pass it down the stack). Requested by: rwatson Notes: svn path=/head/; revision=65527
* The sysctl mod_xx hack is no longer required now that we have totallyPeter Wemm1999-12-121-10/+0
| | | | | | | dynamic sysctl registration. Notes: svn path=/head/; revision=54497
* Move a couple of globals here where they are initialised, rather thanMike Smith1999-11-011-0/+7
| | | | | | | orphaning them in vfs_conf.c Notes: svn path=/head/; revision=52780
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Removed references to a nonexistent variable. This fixes building kernelsBruce Evans1999-07-291-4/+1
| | | | | | | without -O. Notes: svn path=/head/; revision=49206
* * Register sysctl nodes before running sysinits when loading files andDoug Rabson1999-03-071-2/+21
| | | | | | | | | | | unregister them after sysuninits when unloading. * Add code to vfs_register() to set the oid number of vfs sysctls to the type number of the filesystem. Reviewed by: bde Notes: svn path=/head/; revision=44549
* * Change sysctl from using linker_set to construct its tree using SLISTs.Doug Rabson1999-02-161-46/+1
| | | | | | | | | | | | | This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway) Notes: svn path=/head/; revision=44078
* Fix warnings related to -Wall -Wcast-qualMatthew Dillon1999-01-281-2/+2
| | | | Notes: svn path=/head/; revision=43351
* Fix warnings in preparation for adding -Wall -Wcast-qual to theMatthew Dillon1999-01-281-12/+12
| | | | | | | kernel compile Notes: svn path=/head/; revision=43311
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticArchie Cobbs1998-12-071-6/+2
| | | | | | | and local variables, goto labels, and functions declared but not defined. Notes: svn path=/head/; revision=41591
* Fixed the type of vfs_modevent (a little late, to match the correspondingBruce Evans1998-11-151-2/+2
| | | | | | | change in sys/mount.h). Notes: svn path=/head/; revision=41170
* Make the vnode opv vector construction fully dynamic. Previously wePeter Wemm1998-11-101-125/+223
| | | | | | | | | | | | | | | | | | | | | | | leaked memory on each unload and were limited to items referenced in the kernel copy of vnode_if.c. Now a kernel module is free to create it's own VOP_FOO() routines and the rest of the system will happily deal with it, including passthrough layers like union/umap/etc. Have VFS_SET() call a common vfs_modevent() handler rather than inline duplicating the common code all over the place. Have VNODEOP_SET() have the vnodeops removed at unload time (assuming a module) so that the vop_t ** vector is reclaimed. Slightly adjust the vop_t ** vectors so that calling slot 0 is a panic rather than a page fault. This could happen if VOP_something() was called without *any* handlers being present anywhere (including in vfs_default.c). slot 1 becomes the default vector for the vnodeop table. TODO: reclaim zones on unload (eg: nfs code) Notes: svn path=/head/; revision=41056
* General tidy up: remove more unused code, update comments, simplify somePeter Wemm1998-11-041-34/+16
| | | | | | | routines a little. Notes: svn path=/head/; revision=40880
* Nitpicking and dusting performed on a train. Removes trivial warningsPoul-Henning Kamp1998-10-251-12/+2
| | | | | | | about unused variables, labels and other lint. Notes: svn path=/head/; revision=40648
* Fixed sysctl attachment for statically configured vfs's.Bruce Evans1998-10-251-16/+25
| | | | | | | Broken in: previous commit Notes: svn path=/head/; revision=40637
* *gulp*. Jordan specifically OK'ed this..Peter Wemm1998-10-161-79/+194
| | | | | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's. Notes: svn path=/head/; revision=40435
* Taking the GENERIC kernel and commenting out MSDOSFS, CD9660{,_ROOT}, PROCFS,David E. O'Brien1998-10-051-2/+3
| | | | | | | | | | | | | | | | | | NFS_ROOT will produce kernel that cannot mount a UFS /. Vfs type numbers must be distinct from VFS_GENERIC (and VFS_VFSCONF, but that has the same value and should go away). The problem happens because NFS is the first vfs (in sys/conf order) so it gets type number 0 and conflicts harmfully with VFS_GENERIC which is also 0. The conflict is apparently harmless in the usual case when another vfs gets type number 0, because nfs is the only vfs that has sysctls. Inital fix by: Dima <dima@tejblum.dnttm.rssi.ru> Reason why it worked by: bde Notes: svn path=/head/; revision=39975
* Ignore the statically configured vfs type numbers and assign vfsBruce Evans1998-09-051-10/+12
| | | | | | | | | | | | | | type numbers in vfs attach order (modulo incomplete reuse of old numbers after vfs LKMs are unloaded). This requires reinitializing the sysctl tree (or at least the vfs subtree) for vfs's that support sysctls (currently only nfs). sysctl_order() already handled reinitialization reasonably except it checked for annulled self references in the wrong place. Fixed sysctls for vfs LKMs. Notes: svn path=/head/; revision=38869
* Staticize.Eivind Eklund1998-02-091-2/+2
| | | | Notes: svn path=/head/; revision=33181