summaryrefslogtreecommitdiffstats
path: root/sys/fs/fdescfs
Commit message (Collapse)AuthorAgeFilesLines
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-1/+1
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* - Change all LK_SHARE locks to LK_EXCLUSIVE. Shared locks aren't quite safejeff2002-07-091-3/+6
| | | | | yet - Use vop_std{lock,unlock,islocked}.
* Convert fdescfs to nmount.mux2002-05-021-6/+5
| | | | Reviewed by: phk
* Remove __P.alfred2002-03-193-19/+19
|
* Replace ffind_* with fget calls.alfred2002-01-141-7/+3
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.alfred2002-01-132-0/+2
| | | | Requested by: jhb
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-132-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* Backed out vestiges of the quick fixes for the transient breakage ofbde2001-10-132-2/+0
| | | | | <sys/mount.h> in rev.1.106 of the latter (don't include <sys/socket.h> just to work around bugs in <sys/mount.h>).
* KSE Milestone 2julian2001-09-123-41/+41
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Fix warning: 552: warning: `fdesc_badop' defined but not usedpeter2001-06-151-12/+0
|
* Actually rename FDESC, PORTAL, UMAP and UNION file systems.ru2001-05-241-1/+1
| | | | OK'ed by: bp
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-232-2/+2
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* Change the second argument of vflush() to an integer that specifiesiedowse2001-05-161-12/+4
| | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-012-14/+16
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-1/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* fix it so it compiles againmjacob2001-04-232-0/+4
|
* Reviewed by: jlemonadrian2001-03-011-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount.
* 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)
* o Move from Alfred Perstein's "exclusion" technique of handling specialchris2000-10-093-78/+58
| | | | | | | | | file types to requiring all file types to properly implement fo_stat. This makes any new file type additions much easier as this code no longer has to be modified to accomodate it. o Instead of using curproc in fdesc_allocvp, pass a `struct proc' pointer as a new fifth parameter.
* Add snapshots to the fast filesystem. Most of the changes supportmckusick2000-07-111-2/+7
| | | | | | | | | | | | | | | | | | | | the gating of system calls that cause modifications to the underlying filesystem. The gating can be enabled by any filesystem that needs to consistently suspend operations by adding the vop_stdgetwritemount to their set of vnops. Once gating is enabled, the function vfs_write_suspend stops all new write operations to a filesystem, allows any filesystem modifying system calls already in progress to complete, then sync's the filesystem to disk and returns. The function vfs_write_resume allows the suspended write operations to begin again. Gating is not added by default for all filesystems as for SMP systems it adds two extra locks to such critical kernel paths as the write system call. Thus, gating should only be added as needed. Details on the use and current status of snapshots in FFS can be found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness is not included here. Unless and until you create a snapshot file, these changes should have no effect on your system (famous last words).
* fdesc_getattr:chris2000-06-281-6/+2
| | | | | | Don't fake any file types, just set vap->va_type to IFTOVT(stb.st_mode). If something does not report its mode, vap->va_type is set to VNON accordingly.
* by changing the logic here we can support dynamic additions of newalfred2000-06-271-19/+12
| | | | | | filetypes. Reviewed by: green
* if there are leading zeros fail the lookupalfred2000-06-271-0/+5
| | | | Pointed out by: Alexander Viro <viro@math.psu.edu>
* Rename the `VRXEC' macro used to clear read and exec bits to `FDRX' sochris2000-06-201-3/+3
| | | | as not to impede upon VFS namespace.
* Remove unused include <sys/socketvar.h>.chris2000-06-151-1/+0
|
* Replace vattr_null() with VATTR_NULL() and do not explicity set vattrchris2000-06-151-4/+2
| | | | fields to VNOVAL afterwards.
* Instead of completely disallowing VOP_SETATTR, just do it where there ischris2000-06-061-2/+6
| | | | | | an underlying vnode. Suggested by: bde
* Update the comment for fdesc_setattr to reflect that we no longerchris2000-06-021-1/+1
| | | | actually setattr() on underlying vnodes.
* - Do not allow VOP_SETATTR to modify underlying vnodes at all. This causedchris2000-06-022-6/+0
| | | | | | | | | | | | problems when fetch(1) was passed `-o -'. The rationale of this change is that applications attempting to change underlying vnodes for /dev/fd nodes are improperly written and the use of this interface should not ever have been encouraged. Proper alternatives are fchmod, fchown and others. PR: 18952 - Remove stale, unused fdescnode->fd_link structure member.
* Back out the previous change to the queue(3) interface.jake2000-05-262-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-232-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Adapt fdesc to be mounted on /dev/fd and remove fd, stdin, stdout andchris2000-05-112-439/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | stderr nodes. More specific items of this patch: o Removed support for symbolic links, and the need for fdesc_readlink(). o Put all the code from fdesc_attr() into fdesc_getattr() and removed fdesc_attr(). This also made it easier to properly give all nodes unique inode numbers. o The removal of all non-fd nodes allowed the removal of the fdesc_read(), fdesc_write(), and fdesc_ioctl() nodes, since we no longer have nodes that get special handling. o Correct the component name validity-checking in fdesc_lookup(). It previously detected the end of the string by checking for a terminating NUL, now it uses cnp->cn_namelen. o Handle kqueue files as FIFOs. This is probably the closest file type to represent this type of file there is, and it is unfortunately not very representative of a kqueue. Creation time is not supported by kqueue, so ctime, mtime and atime are all set to the current time when getattr() was called. o Also set st_[mca]time to the current time since there's no data in socket structures that can be used to fill this in (FIFOs). o Simplify fdesc_readdir() since it only has to report the numbered fd nodes. Add `.' and `..' directory links as well. o Remove read bits from directories as they tend to confuse programs like tar(1). Reviewed by: phk Discussed with: bde (earlier on, not quite review)
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Second pass commit to introduce new ACL and Extended Attribute systemrwatson1999-12-191-0/+2
| | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind
* Remove unused #includes.phk1999-12-081-1/+0
| | | | Obtained from: http://bogon.freebsd.dk/include
* Fix a warning.peter1999-11-181-0/+3
|
* Update for fileops.fo_stat() addition. Note, this would panic ifpeter1999-11-081-2/+3
| | | | it saw a DTYPE_PIPE. This isn't quite right but should stop a crash.
* Seperate the export check in VFS_FHTOVP, exports are now checked viaalfred1999-09-111-0/+1
| | | | | | | | | VFS_CHECKEXP. Add fh(open|stat|stafs) syscalls to allow userland to query filesystems based on (network) filehandle. Obtained from: NetBSD
* All unimplemented VFS ops now have entries in kern/vfs_default.c that returnalfred1999-09-071-39/+6
| | | | | | | | | | | | | reasonable defaults. This avoids confusing and ugly casting to eopnotsupp or making dummy functions. Bogus casting of filesystem sysctls to eopnotsupp() have been removed. This should make *_vfsops.c more readable and reduce bloat. Reviewed by: msmith, eivind Approved by: phk Tested by: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
* $Id$ -> $FreeBSD$peter1999-08-283-3/+3
|
* Make sure that stat(2) and friends always return a valid st_dev field.phk1999-07-021-2/+1
| | | | | | Pseudo-FS need not fill in the va_fsid anymore, the syscall code will use the first half of the fsid, which now looks like a udev_t with major 255.
* Simplify cdevsw registration.phk1999-05-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-272-4/+4
| | | | kernel compile
* Remove declarations for undefined functions and a couple of unusedeivind1999-01-121-9/+1
| | | | enotsupp implementations.
* Cleanup uninitialized-possibly-used (but really not) warningsdillon1998-12-141-2/+2
|
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-3/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* Removed statically configured mount type numbers (MOUNT_*) and allbde1998-09-071-2/+2
| | | | | | | | | references to them. The change a couple of days ago to ignore these numbers in statically configured vfsconf structs was slightly premature because the cd9660, cfs, devfs, ext2fs, nfs vfs's still used MOUNT_* instead of the number in their vfsconf struct.
* Avoid a 64-bit division in fdesc_readdir(). Fixed related overflowsbde1998-06-141-27/+14
| | | | | | | | and missing arg checking. Panic instead of returning bogus error codes or forgetting to check all cases if fdesc_readdir() gets called for a non-directory. This can't happen.
* Make these files compile.dfr1998-06-101-1/+2
|
* ENOPNOTSUPP --> EOPNOTSUPPalex1998-06-101-2/+2
| | | | | PR: 6906 Submitted by: Steven G. Kargl <kargl@troutmask.apl.washington.edu>
OpenPOWER on IntegriCloud