summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Use vop_defaultop() instead of ntfs_bypass().bp2000-11-181-2/+6
| | | | PR: kern/22756
* Missed conversion of CIRCLEQ => TAILQ for mount list.mckusick2000-11-141-1/+1
|
* More paranoia against overflowseivind2000-11-081-18/+45
|
* v_interlock is a mutex now, not simple lock.bp2000-11-041-1/+1
|
* Take VBLK devices further out of their missery.phk2000-11-021-9/+2
| | | | This should fix the panic I introduced in my previous commit on this topic.
* Fix overflow from jail hostname.eivind2000-11-011-1/+1
| | | | Bug found by: Esa Etelavuori <eetelavu@cc.hut.fi>
* Give vop_mmap an untimely death. The opportunity to give it a timelyeivind2000-11-015-21/+0
| | | | death timed out in 1996.
* Make malloc use M_ZERO in some more locations.dwmalone2000-10-292-5/+2
| | | | | | | | Don't check for a null pointer if malloc called with M_WAITOK. Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: bp
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-294-4/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* Weaken a bogus dependency on <sys/proc.h> in <sys/buf.h> by #ifdef'ingphk2000-10-293-3/+0
| | | | | | | | | | the offending inline function (BUF_KERNPROC) on it being #included already. I'm not sure BUF_KERNPROC() is even the right thing to do or in the right place or implemented the right way (inline vs normal function). Remove consequently unneeded #includes of <sys/proc.h>
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-2912-12/+0
|
* Rev 1.41 was committed from wrong diff, now do it right.bp2000-10-221-1/+1
|
* Release and unlock vnode if resource deadlock detected.bp2000-10-221-0/+1
|
* Update stale comment.bp2000-10-221-3/+1
| | | | PR: kern/21805
* Remove de_lock field from denode structure and make msdosfs PDIRUNLOCK aware.bp2000-10-224-13/+27
|
* Fix nullfs breakage caused by incomplete migration of v_interlock frombp2000-10-151-3/+5
| | | | | | simple_lock to mutex. Reset LK_INTERLOCK flag when interlock released manually.
* 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.
* Blow away the v_specmountpoint define, replacing it with what it waseivind2000-10-095-16/+16
| | | | defined as (rdev->si_mountpoint)
* Don't hold an extra reference to vnodes. Devfs vnodes are sufficientlyphk2000-10-093-24/+28
| | | | | | | | | | | | | | cheap to setup that it doesn't really matter that we recycle device vnodes at kleenex speed. Implement first cut try at killing cloned devices when they are not needed anymore. For now only the bpf driver is involved in this experiment. Cloned devices can set the SI_CHEAPCLONE flag which allows us to destroy_dev() it when the vcount() drops to zero and the vnode is reclaimed. For now it's a requirement that the driver doesn't keep persistent state from close to (re)open. Some whitespace changes.
* return correct type for process directory entries, DT_DIR not DT_REGalfred2000-10-051-1/+1
|
* Forward-declare struct mbuf so that this file is less self-insufficientbde2000-10-051-0/+1
| | | | | | | -- don't depend on garbage in <sys/mount.h>. mbufs aren't actually used here either. They should have been completely removed from filesystem interfaces when they were removed from the interfaces to convert between file handles and vnodes.
* Convert lockmgr locks from using simple locks to using mutexes.jasone2000-10-0421-30/+111
| | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed.
* Make cd9660 filesystem PDIRUNLOCK aware. Now it can be used in vnode stacksbp2000-10-034-9/+18
| | | | | | and nullfs mounts. Remove now unnecessary i_lock field from the iso_node structure.
* Prevent dereference of NULL pointer when null_lock() and null_unlock()bp2000-10-031-1/+7
| | | | called and there is no underlying vnode.
* Protect hash data with lock manager instead of home grown one.bp2000-10-024-71/+105
| | | | | | | | | Replace shared lock on vnode with exclusive one. It shouldn't impact perfomance as NCP protocol doesn't support outstanding requests. Do not hold simple lock on vnode for long period of time. Add functionality to the nwfs_print() routine.
* Get rid from the legacy __P() macro. Remove 'register' keywords.bp2000-10-026-95/+99
|
* PDIRUNLOCK now exists on FreeBSD. Remove the (now incorrect) redefinition.peter2000-10-021-4/+0
|
* Fix vnode locking bugs in the nullfs.bp2000-09-253-98/+286
| | | | | | | | | | | | Add correct support for v_object management, so mmap() operation should work properly. Add support for extattrctl() routine (submitted by semenu). At this point nullfs can be considered as functional and much more stable. In fact, it should behave as a "hard" "symlink" to underlying filesystem. Reviewed in general by: mckusick, dillon Parts of logic obtained from: NetBSD
* Ignore attempts to set flags to zero. This quenches a syslog warningphk2000-09-181-1/+1
| | | | from login(1).
* Add canonical checks to devfs_setattr().phk2000-09-161-14/+50
|
* Use size_t instead of u_int for 4th argument to copyinstr().jhb2000-09-121-1/+1
|
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-09-071-0/+1
| | | | | | | | | | | | | | | include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh
* Add refcounts to the "global" DEVFS inode slots, this allows usphk2000-09-064-71/+294
| | | | | | | | | | | | | | | | | | | to recycle inodes after a destroy_dev() but not until all mounts have picked up the change. Add support for an overflow table for DEVFS inodes. The static table defaults to 1024 inodes, if that fills, an overflow table of 32k inodes is allocated. Both numbers can be changed at compile time, the size of the overflow table also with the sysctl vfs.devfs.noverflow. Use atomic instructions to barrier between make_dev()/destroy_dev() and the mounts. Add lockmgr() locking of directories for operations accessing or modifying the directory TAILQs. Various nitpicking here and there.
* Various cleanups towards make nullfs functional (it is still brokenbp2000-09-054-38/+130
| | | | | | | | | | | | | | | | | | | | at this point): Replace all '#ifdef DEBUG' with '#ifdef NULLFS_DEBUG' and add NULLFSDEBUG macro. Protect nullfs hash table with lockmgr. Use proper order of operations when freeing mnt_data. Return correct fsid in the null_getattr(). Add null_open() function to catch MNT_NODEV (obtained from NetBSD). Add null_rename() to catch cross-fs rename operations (submitted by Ustimenko Semen <semen@iclub.nsu.ru>) Remove duplicate $FreeBSD$ tags.
* Get rid from the __P() macros.bp2000-09-054-37/+36
| | | | Encouraged by: peter
* Off by one error.phk2000-09-041-1/+1
| | | | Submitted by: des
* Remove a comment that has been not only obsolete but patently wrong for thedes2000-09-041-8/+0
| | | | last 31 revisions (almost three years).
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-023-31/+4
| | | | | | | | | | | | | | | | | | cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
* o Simplify if/then clause equating ESRCH with ENOENT when hiding a processrwatson2000-09-011-5/+2
| | | | Submitted by: des
* o Make procfs use vaccess() for procfs_access() DAC and super-user checks,rwatson2000-09-011-28/+4
| | | | | | | rather than implementing its own {uid,gid,other} checks against vnode mode. Similar change to linprocfs currently under review. Obtained from: TrustedBSD Project
* o Centralize inter-process access control, introducing:rwatson2000-08-306-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int p_can(p1, p2, operation, privused) which allows specification of subject process, object process, inter-process operation, and an optional call-by-reference privused flag, allowing the caller to determine if privilege was required for the call to succeed. This allows jail, kern.ps_showallprocs and regular credential-based interaction checks to occur in one block of code. Possible operations are P_CAN_SEE, P_CAN_SCHED, P_CAN_KILL, and P_CAN_DEBUG. p_can currently breaks out as a wrapper to a series of static function checks in kern_prot, which should not be invoked directly. o Commented out capabilities entries are included for some checks. o Update most inter-process authorization to make use of p_can() instead of manual checks, PRISON_CHECK(), P_TRESPASS(), and kern.ps_showallprocs. o Modify suser{,_xxx} to use const arguments, as it no longer modifies process flags due to the disabling of ASU. o Modify some checks/errors in procfs so that ENOENT is returned instead of ESRCH, further improving concealment of processes that should not be visible to other processes. Also introduce new access checks to improve hiding of processes for procfs_lookup(), procfs_getattr(), procfs_readdir(). Correct a bug reported by bp concerning not handling the CREATE case in procfs_lookup(). Remove volatile flag in procfs that caused apparently spurious qualifier warnigns (approved by bde). o Add comment noting that ktrace() has not been updated, as its access control checks are different from ptrace(), whereas they should probably be the same. Further discussion should happen on this topic. Reviewed by: bde, green, phk, freebsd-security, others Approved by: bde Obtained from: TrustedBSD Project
* o Restructure vaccess() so as to check for DAC permission to modify therwatson2000-08-295-5/+5
| | | | | | | | | | | | | | | | object before falling back on privilege. Make vaccess() accept an additional optional argument, privused, to determine whether privilege was required for vaccess() to return 0. Add commented out capability checks for reference. Rename some variables to make it more clear which modes/uids/etc are associated with the object, and which with the access mode. o Update file system use of vaccess() to pass NULL as the optional privused argument. Once additional patches are applied, suser() will no longer set ASU, so privused will permit passing of privilege information up the stack to the caller. Reviewed by: bde, green, phk, -security, others Obtained from: TrustedBSD Project
* Reorder vop's alphabetically.phk2000-08-274-245/+278
| | | | | | Smarter use of devfs_allocv() (from bp@) Introduce devfs_find() ".." fixes to devfs_lookup (from bp@)
* Minor cleanups tp devfs_readdir();phk2000-08-261-11/+33
| | | | Add devfs_read() for directories. (inspired by bp@)
* Quick fix for msdsofs_write() on alphas and other machines with eitherbde2000-08-252-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | longs larger than 32 bits or strict alignment requirements. pm_fatmask had type u_long, but it must have a type that has precisely 32 bits and this type must be no smaller than int, so that ~pmp->pm_fatmask has no bits above the 31st set. Otherwise, comparisons between (cn | ~pmp->pm_fatmask) and magic 32-bit "cluster" numbers always fail. The correct fix is to use the C99 type uint_least32_t and mask with 0xffffffff. The quick fix is to use u_int32_t and assume that ints have msdosfs metadata is riddled with unaligned fields, and on alphas, unaligned_fixup() apparently has problems fixing up the unaligned accesses caused by this. The quick fix is to not comment out the NetBSD code that sort of handles this, and define UNALIGNED_ACCESS on i386's so that the code doesn't change on i386's. The correct fix would define UNALIGNED_ACCESS in a central machine-dependent header and maybe add some extra cases to unaligned_fixup(). UNALIGNED_ACCESS is also tested in isofs. Submitted by: parts by Mark Abene <phiber@radicalmedia.com> PR: 19086
* Fix panic when removing open device (found by bp@)phk2000-08-245-131/+204
| | | | | | | | | | | | Implement subdirs. Build the full "devicename" for cloning functions. Fix panic when deleted device goes away. Collaps devfs_dir and devfs_dirent structures. Add proper cloning to the /dev/fd* "device-"driver. Fix a bug in make_dev_alias() handling which made aliases appear multiple times. Use devfs_clone to implement getdiskbyname() Make specfs maintain the stat(2) timestamps per dev_t
* Fix devfs_access() bug on directories.phk2000-08-213-13/+8
| | | | | | Remove unused #includes. Bug spotted by: markm
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-204-0/+1139
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old DEVFS support fields from dev_t. Make uid, gid & mode members of dev_t and set them in make_dev(). Use correct uid, gid & mode in make_dev in disk minilayer. Add support for registering alias names for a dev_t using the new function make_dev_alias(). These will show up as symlinks in DEVFS. Use makedev() rather than make_dev() for MFSs magic devices to prevent DEVFS from noticing this abuse. Add a field for DEVFS inode number in dev_t. Add new DEVFS in fs/devfs. Add devfs cloning to: disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) md(4), tun(4), bpf(4), fd(4) If DEVFS add -d flag to /sbin/inits args to make it mount devfs. Add commented out DEVFS to GENERIC
* Centralize the canonical vop_access user/group/other check in vaccess().phk2000-08-204-166/+13
| | | | Discussed with: bde
* Introduce vop_stdinactive() and make it the default if no vop_inactivephk2000-08-184-68/+2
| | | | | | is declared. Sort and prune a few vop_op[].
OpenPOWER on IntegriCloud