summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* 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[].
* Rename the loadable nullfs kernel module: null -> nullfssheldonh2000-07-281-1/+1
|
* This patch corrects the first round of panics and hangs reportedmckusick2000-07-242-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the new snapshot code. Update addaliasu to correctly implement the semantics of the old checkalias function. When a device vnode first comes into existence, check to see if an anonymous vnode for the same device was created at boot time by bdevvp(). If so, adopt the bdevvp vnode rather than creating a new vnode for the device. This corrects a problem which caused the kernel to panic when taking a snapshot of the root filesystem. Change the calling convention of vn_write_suspend_wait() to be the same as vn_start_write(). Split out softdep_flushworklist() from softdep_flushfiles() so that it can be used to clear the work queue when suspending filesystem operations. Access to buffers becomes recursive so that snapshots can recursively traverse their indirect blocks using ffs_copyonwrite() when checking for the need for copy on write when flushing one of their own indirect blocks. This eliminates a deadlock between the syncer daemon and a process taking a snapshot. Ensure that softdep_process_worklist() can never block because of a snapshot being taken. This eliminates a problem with buffer starvation. Cleanup change in ffs_sync() which did not synchronously wait when MNT_WAIT was specified. The result was an unclean filesystem panic when doing forcible unmount with heavy filesystem I/O in progress. Return a zero'ed block when reading a block that was not in use at the time that a snapshot was taken. Normally, these blocks should never be read. However, the readahead code will occationally read them which can cause unexpected behavior. Clean up the debugging code that ensures that no blocks be written on a filesystem while it is suspended. Snapshots must explicitly label the blocks that they are writing during the suspension so that they do not cause a `write on suspended filesystem' panic. Reorganize ffs_copyonwrite() to eliminate a deadlock and also to prevent a race condition that would permit the same block to be copied twice. This change eliminates an unexpected soft updates inconsistency in fsck caused by the double allocation. Use bqrelse rather than brelse for buffers that will be needed soon again by the snapshot code. This improves snapshot performance.
* Certain error contitions cause msdosfs_rename() to decrement thedwmalone2000-07-141-2/+2
| | | | | | | | vnode reference count on 'fdvp' more times than it should. PR: 17347 Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Approved by: bde
* Add snapshots to the fast filesystem. Most of the changes supportmckusick2000-07-115-12/+66
| | | | | | | | | | | | | | | | | | | | 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).
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-2/+2
| | | | Pointed out by: bde
* Pull the rug under block mode devices. they return ENXIO on open(2) now.phk2000-07-031-3/+3
|
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-2/+2
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Fix memory leakage on module unload.bp2000-06-293-1/+12
| | | | Spotted by: fixed INVARIANTS code
* Fix memory leakage on module unload.bp2000-06-293-1/+12
| | | | Spotted by: fixed INVARIANTS code
* 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>
* Remove obsolete comment.bp2000-06-251-5/+0
| | | | Submitted by: Marius Bendiksen <mbendiks@eunet.no>
* 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.
* Virtualizes & untangles the bioops operations vector.phk2000-06-161-3/+2
| | | | Ref: Message-ID: <18317.961014572@critter.freebsd.dk> To: current@
* Remove unused include <sys/socketvar.h>.chris2000-06-151-1/+0
|
OpenPOWER on IntegriCloud