summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
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-091-5/+5
| | | | defined as (rdev->si_mountpoint)
* return correct type for process directory entries, DT_DIR not DT_REGalfred2000-10-051-1/+1
|
* Convert lockmgr locks from using simple locks to using mutexes.jasone2000-10-043-2/+7
| | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed.
* Prevent dereference of NULL pointer when null_lock() and null_unlock()bp2000-10-031-1/+7
| | | | called and there is no underlying vnode.
* 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
* Fix a 64-bitism, use size_t instead of u_int for 4th arg to copyinstr.jhb2000-09-111-1/+1
|
* 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
* Remove a comment that has been not only obsolete but patently wrong for thedes2000-09-041-8/+0
| | | | last 31 revisions (almost three years).
* 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-291-1/+1
| | | | | | | | | | | | | | | | 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
* Fix panic when removing open device (found by bp@)phk2000-08-241-3/+11
| | | | | | | | | | | | 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
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-207-4017/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-28/+1
| | | | Discussed with: bde
* Introduce vop_stdinactive() and make it the default if no vop_inactivephk2000-08-185-85/+2
| | | | | | is declared. Sort and prune a few vop_op[].
* Rename the loadable nullfs kernel module: null -> nullfssheldonh2000-07-281-1/+1
|
* Remove stale, unused and bogus root device hunting code.phk2000-07-272-25/+0
|
* This patch corrects the first round of panics and hangs reportedmckusick2000-07-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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).
* Pull the rug under block mode devices. they return ENXIO on open(2) now.phk2000-07-031-3/+3
|
* 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.
* Virtualizes & untangles the bioops operations vector.phk2000-06-162-6/+4
| | | | Ref: Message-ID: <18317.961014572@critter.freebsd.dk> To: current@
* 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.
* before this commit, specfs reported disk partitionsjmb2000-06-121-1/+1
| | | | | | | | | using decimal major and minor numbers. "ls -l" reports disk partitions using decimal major numbers and hex minor numbers. make specfs use decimal major numbers and hex minor numbers, just like "ls -l"
* 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-269-10/+10
| | | | | | 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-239-10/+10
| | | | | | | | 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 the "bdev-whiner" to whine when open is attempted and extendphk2000-05-091-0/+9
| | | | the deadline a month.
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-053-0/+3
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* Add $FreeBSD$peter2000-05-013-0/+6
|
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-303-3/+0
| | | | Generated by: src/tools/tools/kerninclude
* Remove unneeded #include <sys/kernel.h>phk2000-04-291-1/+0
|
* Move procfs_fullpath() to vfs_cache.c, with a rename to textvp_fullpath().green2000-04-263-99/+2
| | | | | | | | | | There's no excuse to have code in synthetic filestores that allows direct references to the textvp anymore. Feature requested by: msmith Feature agreed to by: warner Move requested by: phk Move agreed to by: bde
* Quiet an unused variable warning by commenting out a variable declarationgreen2000-04-221-1/+1
| | | | that goes with a commented out statement.
* There's no reason to make "file" 0500 rather than 0555.green2000-04-221-1/+3
|
* Welcome back our old friend from procfs, "file"!green2000-04-223-19/+155
|
* Remove the linprocfs bits from their old location, as they've moved now.msmith2000-04-205-1862/+0
|
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-1/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* Remove unneeded <sys/buf.h> includes.phk2000-04-183-3/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Introduce kqueue() and kevent(), a kernel event notification facility.jlemon2000-04-161-0/+86
|
OpenPOWER on IntegriCloud