summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_export.c
Commit message (Collapse)AuthorAgeFilesLines
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-151-1/+1
| | | | | | | | | | | | | | | | This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs
* When exiting vfs_export(), delete the "export" option fromrodrigc2007-01-231-11/+31
| | | | | | | | | | | | | | | | | | the mount options list with vfs_deleteopt(). At this point, the export information is saved in mp->mnt_export, so we can delete the "export" mount option from mp->mnt_optnew and mp->mnt_opt. This fixes read-write/read-only update mounts (mount -u -o rw, mount -u -o ro) of NFS exported directories. For some reason, I could only reproduce the problem with a configuration supplied by Andre: - "options QUOTA" enabled in kernel config - "/ -maproot=root 10.0.1.105" in /etc/exports Reported by: kris, Andre Guibert de Bruet <andy siliconlandmark com>, Andrzej Tobola <ato iem pw edu pl> Tested by: Andre Guibert de Bruet
* In vfs_export(), if we specify MNT_DELEXPORT in the struct export_args,rodrigc2006-12-161-1/+4
| | | | | | | | | | | | | after we perform the operations to delete the export, call vfs_deleteopt() to delete the "export" mount option from the linked list of mount options associated with that mount point. This fixes one scenario: - put a filesystem in /etc/exports to export it - remove the filesystem from /etc/exports to delete the export and restart mountd - try to do a "mount -u -o ro" or "mount -u -o rw" on that filesystem now that it is no longer exported.
* Convert to ANSI-style function prototypes.rodrigc2006-12-161-21/+9
|
* Use vfs_mount_error() to log mount errors in a few places with humanrodrigc2006-12-071-1/+8
| | | | | readable strings which can be retrieved if an "errmsg" parameter is passed into nmount().
* Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.tegge2006-09-261-0/+10
| | | | | This eliminates a race where MNT_UPDATE flag could be lost when nmount() raced against sync(), sync_fsync() or quotactl().
* 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.
* Use the refcount API to manage the reference count for user credentialsjhb2005-09-271-2/+3
| | | | | | rather than using pool mutexes. Tested on: i386, alpha, sparc64
* Handle theoretical case of vfs_export being called with both MNT_DELEXPORT andkan2005-05-111-0/+1
| | | | MNT_EXPORT flags set. Do not reuse the memory that has just been freed.
* - Pass LK_EXCLUSIVE to VFS_ROOT() to satisfy the new flags argument. Forjeff2005-03-241-1/+1
| | | | | | now, all calls to VFS_ROOT() should still acquire exclusive locks. Sponsored by: Isilon Systems, Inc.
* Make various mountpoint related functions static.phk2005-02-101-4/+3
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Sigh. I really need to get an internet connection which is less thancperciva2004-11-291-1/+1
| | | | | | | | 2km away from where I'm living, so that I can fix these typos sooner. s/SA_MAX/AF_MAX/ is previous commit. Reported by: marcus, ups, Yiawei Ye, dwhite
* Check that saddr->sa_family is a sensible value before using it.cperciva2004-11-281-0/+4
| | | | | Reported by: Bryan Fulton and Ted Unangst, Coverity, Inc. Found by: The SWAT analysis tool
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-121-1/+1
| | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread.
* Include <sys/mutex.h> and its prerequisite <sys/lock.h> instesd of dependingbde2004-04-211-5/+8
| | | | | | on namespace pollution in <sys/vnode.h>. Sorted includes.
* Remove advertising clause from University of California Regent's license,imp2004-04-051-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Guard against MLEN growing larger than a uint8_t due to MSIZE grwoing to ascottl2003-07-261-0/+2
| | | | value of 512 in LINT. This keeps gcc from complaining.
* Use __FBSDID().obrien2003-06-111-1/+3
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-3/+3
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-3/+3
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* SMP locking for radix nodes.hsu2002-12-241-4/+10
|
* Partial backout of 1.318, remove error handling added because it may bealfred2002-06-301-15/+3
| | | | | | incorrect. Requested by: bde
* Fix several style bugs:alfred2002-06-291-7/+17
| | | | | | | | | close up the continued line after removing the cast made the line. space before parentheses in indirect function call. Add an addtional error handler case for the results of callback. Submitted by: bde
* Unbreak computation of 'smask' that I broke when removing caddr_t.alfred2002-06-291-1/+1
| | | | Submitted by: bde
* nuke caddr_t.alfred2002-06-281-10/+9
|
* Fixed some style bugs in the removal of __P(()). The main ones werebde2002-03-241-1/+1
| | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
* Remove __P.alfred2002-03-191-4/+4
|
* Check the version of ex_anon (a `struct xucred') before using it todd2002-03-031-0/+10
| | | | | | fill out netc_anon (a `struct ucred'), and add an XXX around the entire operation since it isn't clear whether it's doing the right thing with things like cr_uidinfo and cr_prison.
* Fix some signed/unsigned integer confusion, and add bounds checking ofkris2001-09-101-0/+5
| | | | | | | | arguments to some functions. Obtained from: NetBSD Reviewed by: peter MFC after: 2 weeks
* Since the netexport struct was centralised to 'struct mount',iedowse2001-05-291-1/+1
| | | | | | | | | | | | | attempting to remove nonexistant exports with MNT_DELEXPORT returns an error; before this change it always succeeded. This caused mountd(8) to log "can't delete exports for /whatever" warnings. Change the error code from EINVAL to a more specific ENOENT, and make mountd ignore this error when deleting the export list. I could have just restored the previous behaviour of returning success, but I think an error return is a useful diagnostic. Reviewed by: phk
* vfs_subr.c is getting rather fat. The underlying repocopy and thisphk2001-04-261-2852/+4
| | | | commit moves the filesystem export handling code to vfs_export.c
* Move the netexport structure from the fs-specific mountstructurephk2001-04-251-5/+61
| | | | | | | | | | | | | | to struct mount. This makes the "struct netexport *" paramter to the vfs_export and vfs_checkexport interface unneeded. Consequently that all non-stacking filesystems can use vfs_stdcheckexp(). At the same time, make it a pointer to a struct netexport in struct mount, so that we can remove the bogus AF_MAX and #include <net/radix.h> from <sys/mount.h>
* Correct #includes to work with fixed sys/mount.h.grog2001-04-231-0/+2
|
* Reclaim directory vnodes held in namecache if few free vnodes aretanimura2001-04-181-0/+26
| | | | | | | | | | | | | | | available. Only directory vnodes holding no child directory vnodes held in v_cache_src are recycled, so that directory vnodes near the root of the filesystem hierarchy remain in namecache and directory vnodes are not reclaimed in cascade. The period of vnode reclaiming attempt and the number of vnodes attempted to reclaim can be tuned via sysctl(2). Suggested by: tegge Approved by: phk
* This patch removes the VOP_BWRITE() vector.phk2001-04-171-1/+1
| | | | | | | | | | | | | VOP_BWRITE() was a hack which made it possible for NFS client side to use struct buf with non-bio backing. This patch takes a more general approach and adds a bp->b_op vector where more methods can be added. The success of this patch depends on bp->b_op being initialized all relevant places for some value of "relevant" which is not easy to determine. For now the buffers have grown a b_magic element which will make such issues a tiny bit easier to debug.
* Add a NOTE_REVOKE flag for vnodes, which is triggered from within vclean().jlemon2001-02-231-0/+5
| | | | | | | Use this to tell a filter attached to a vnode that the underlying vnode is no longer valid, by returning EV_EOF. PR: kern/25309, kern/25206
* Switch to using a struct xucred instead of a struct xucred when notgreen2001-02-181-2/+10
| | | | | | | | | | | | | | | | | actually in the kernel. This structure is a different size than what is currently in -CURRENT, but should hopefully be the last time any application breakage is caused there. As soon as any major inconveniences are removed, the definition of the in-kernel struct ucred should be conditionalized upon defined(_KERNEL). This also changes struct export_args to remove dependency on the constantly-changing struct ucred, as well as limiting the bounds of the size fields to the correct size. This means: a) mountd and friends won't break all the time, b) mountd and friends won't crash the kernel all the time if they don't know what they're doing wrt actual struct export_args layout. Reviewed by: bde
* Change and clean the mutex lock interface.bmilekic2001-02-091-87/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-1/+1
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Properly lock new vnode.bp2001-01-311-4/+9
| | | | Reminded by: tegge
* Convert all simplelocks to mutexes and remove the simplelock implementations.jasone2001-01-241-55/+55
|
* o The move to using VADMIN under vaccess() resulted in some systemrwatson2001-01-231-1/+1
| | | | | | | | | | | calls returning EACCES instead of EPERM. This patch modifies vaccess() to return EPERM instead of EACCES if VADMIN is among the requested rights. This affects functions normally limited to the owners of a file, such as chmod(), as EPERM is the error indicating that privilege would allow the operation, rather than a chance in mandatory or discretionary rights. Reported by: bde
* Stick the kthread API in a kthread_* namespace, and the specialized kprocjhb2000-12-151-2/+2
| | | | | | functions in a kproc_* namespace. Reviewed by: -arch
* Use proper mutex locking when calling setrunnable from speedup_syncer().mckusick2000-12-131-3/+2
| | | | Submitted by: Tor.Egge@fast.no
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-4/+2
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Untangle vfsinit() a bit. Use seperate sysinit functions rather thanpeter2000-12-061-2/+4
| | | | having a super-function calling bits all over the place.
* Correct int/long type mismatch in the proper place this time. freevnodesgallatin2000-12-021-3/+3
| | | | | | | | | | | and numvnodes are longs in the kernel. They should remain longs in systat, what really needs to change is that they should be using SYSCTL_LONG rather than SYSCTL_INT. I also changed wantfreevnodes to SYSCTL_LONG because I happened to notice it. I wish there was a way to find all of these automatically.. Pointed out by: bde
* Use msleep() instead of mtx_exit()/tsleep() so that we release the lock andjhb2000-12-011-13/+7
| | | | go to sleep as an "atomic" operation.
* Get rid of a bogus mtx_exit (it was attempting to release anmckusick2000-11-301-1/+0
| | | | | | already released mutex). Submitted by: "Chris Knight" <chris@aims.com.au>
OpenPOWER on IntegriCloud