aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vn
Commit message (Collapse)AuthorAgeFilesLines
* Remove vn(4) driver.Poul-Henning Kamp2001-03-091-794/+0
| | | | Notes: svn path=/head/; revision=74048
* Back out proc locking to protect p_ucred for obtaining additionalJohn Baldwin2001-01-271-19/+5
| | | | | | | references along with the actual obtaining of additional references. Notes: svn path=/head/; revision=71699
* Proc locking to protect p_ucred while we obtain another reference to it.John Baldwin2001-01-231-5/+19
| | | | Notes: svn path=/head/; revision=71478
* Remove cdevsw when unloading the vn module.Nick Hibma2001-01-071-0/+1
| | | | | | | Submitted by: dunno... :-( Notes: svn path=/head/; revision=70758
* Add a cloning function to vn(4) which triggers on "vn%d.ctl". Give thePoul-Henning Kamp2000-12-161-52/+112
| | | | | | | | | | .ctl devices their own cdevsw since no I/O can or should be done on them. Vn(4) is still not entirely DEVFS friendly since it only creates vn%d nodes. Notes: svn path=/head/; revision=70097
* Include vm/vm_zone.h prior to vm/swap_pager.h.Seigo Tanimura2000-12-131-0/+1
| | | | | | | | Noticed by: Michael Harnois <mdharnois@home.com> Submitted by: assar Notes: svn path=/head/; revision=69986
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-2/+1
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Make labels mandatory for vn(4).Poul-Henning Kamp2000-12-011-102/+50
| | | | Notes: svn path=/head/; revision=69499
* Call make_dev() with the correct minor number.Poul-Henning Kamp2000-09-261-1/+2
| | | | | | | (no, this driver still doesn't play ball with DEVFS) Notes: svn path=/head/; revision=66395
* GC some old no longer supported options.Poul-Henning Kamp2000-09-251-3/+1
| | | | Notes: svn path=/head/; revision=66352
* Add snapshots to the fast filesystem. Most of the changes supportKirk McKusick2000-07-111-9/+9
| | | | | | | | | | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=62976
* Move the truncation code out of vn_open and into the open system callKirk McKusick2000-07-041-2/+2
| | | | | | | | | | | | | after the acquisition of any advisory locks. This fix corrects a case in which a process tries to open a file with a non-blocking exclusive lock. Even if it fails to get the lock it would still truncate the file even though its open failed. With this change, the truncation is done only after the lock is successfully acquired. Obtained from: BSD/OS Notes: svn path=/head/; revision=62550
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-2/+2
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-2/+2
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Zero out the uio structure prior to initializing it. A garbage ↵Matthew Dillon2000-05-141-4/+9
| | | | | | | | | | | | (uninitialized) proc pointer is believed to have been the cause of panics related to vnconfig on top of intr-optioned NFS mounts. Reported by: "Sean O'Connell" <sean@stat.Duke.EDU> Notes: svn path=/head/; revision=60547
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-051-5/+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 Notes: svn path=/head/; revision=60041
* Convert the vm_pager_strategy() interface to take a struct bio instead ofPoul-Henning Kamp2000-05-031-2/+0
| | | | | | | | | a struct buf. Don't try to examine B_ASYNC, it is a layering violation to do so. The only current user of this interface is vn(4) which, since it emulates a disk interface, operates on struct bio already. Notes: svn path=/head/; revision=59915
* Remove unneeded #include <vm/vm_zone.h>Poul-Henning Kamp2000-04-301-1/+0
| | | | | | | Generated by: src/tools/tools/kerninclude Notes: svn path=/head/; revision=59794
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-151-34/+36
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-021-6/+9
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-03-201-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful. Notes: svn path=/head/; revision=58345
* Fix a panic when doing non-multiples of PAGE_SIZE or misaligned transfersPeter Wemm1999-12-281-1/+13
| | | | | | | | | to a swap backed vn device. OK'ed by: dillon Notes: svn path=/head/; revision=55176
* Introduce NDFREE (and remove VOP_ABORTOP)Eivind Eklund1999-12-151-0/+1
| | | | Notes: svn path=/head/; revision=54655
* Lock reporting and assertion changes.Eivind Eklund1999-12-111-1/+1
| | | | | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter Notes: svn path=/head/; revision=54444
* Remove the devsw magic from DEV_MODULE()Poul-Henning Kamp1999-11-071-1/+2
| | | | Notes: svn path=/head/; revision=52965
* useracc() the prequel:Poul-Henning Kamp1999-10-291-1/+0
| | | | | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument. Notes: svn path=/head/; revision=52635
* Remove the D_NOCLUSTER[RW] options which were added because vn hadPoul-Henning Kamp1999-09-301-1/+0
| | | | | | | | problems. Now that Matt has fixed vn, this can go. The vn driver should have used d_maxio (now si_iosize_max) anyway. Notes: svn path=/head/; revision=51808
* Zap #include "vn.h" - it's not usedPeter Wemm1999-09-271-1/+0
| | | | Notes: svn path=/head/; revision=51707
* If the request crosses EOF and bp->b_bcount is not a multiple ofMatthew Dillon1999-09-271-2/+1
| | | | | | | | | | the sector size, the new value for bp->b_bcount was incorrectly calculated. Fixed. Submitted by: Tor.Egge@fast.no Notes: svn path=/head/; revision=51703
* Remove five now unused fields from struct cdevsw. They should neverPoul-Henning Kamp1999-09-251-5/+0
| | | | | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags Notes: svn path=/head/; revision=51658
* Fix the situation where an I/O crosses the EOF point. We need to properlyMatthew Dillon1999-09-201-4/+29
| | | | | | | | | | | | adjust the bp->b_bcount the same way for unlabeled VN access as dscheck does for labeled access. We also increase the block size to at least 8K for efficiency. Reviewed by: Tor.Egge@fast.no Notes: svn path=/head/; revision=51469
* Only assign to si_bsize_phys if we have an intelligent value for it.Poul-Henning Kamp1999-09-181-1/+0
| | | | | | | Otherwise leave at zero and let the generic code decide. Notes: svn path=/head/; revision=51378
* Fix a bug in the block number calculation for VN disks with a sectorMatthew Dillon1999-09-171-10/+48
| | | | | | | | | | | | | | | | | | | | | | | size != 512 that are configured without a label. The bug should only have effected swap-backed VN mounts without a label. Add several major features to VN. In the kernel we add a swap pre-reservation capability, which can be used to guarentee seek consistency for swap-backed VN nodes. This also incidently allows a swap-backed VN filesystem to be recovered after a crash in some cases (if the same swap blocks happen to be reserved). We also add a number of new options to vnconfig which do the work of pre-zeroing or creating/truncating/extending a file which greatly simplifies using VN in a file-backed configuration. Add FreeBSD CVS label to sys/sys/vnioctl.h, as well as a new ioctl flag for the swap pre-reservation feature. Reviewed by: Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com> Notes: svn path=/head/; revision=51341
* Changes to centralise the default blocksize behaviour.Julian Elischer1999-09-091-4/+1
| | | | | | | | | More likely to follow. Submitted by: phk@freebsd.org Notes: svn path=/head/; revision=51111
* Revert a bunch of contraversial changes by PHK. AfterJulian Elischer1999-09-031-1/+4
| | | | | | | | | | | | | a quick think and discussion among various people some form of some of these changes will probably be recommitted. The reversion requested was requested by dg while discussions proceed. PHK has indicated that he can live with this, and it has been agreed that some form of some of these changes may return shortly after further discussion. Notes: svn path=/head/; revision=50830
* Make bdev userland access work like cdev userland access unlessPoul-Henning Kamp1999-08-301-4/+1
| | | | | | | | | | | | | the highly non-recommended option ALLOW_BDEV_ACCESS is used. (bdev access is evil because you don't get write errors reported.) Kill si_bsize_best. Use the specfs routines rather having cloned copies in devfs. Notes: svn path=/head/; revision=50622
* We don't need to pass the diskname argument all over the diskslice/labelPoul-Henning Kamp1999-08-281-4/+2
| | | | | | | code, we can find the name from any convenient dev_t Notes: svn path=/head/; revision=50511
* Back out the cdevsw_remove() from previous revision for further testing.Brian Feldman1999-08-281-1/+0
| | | | Notes: svn path=/head/; revision=50494
* Unevilize vn(4) somewhat:Brian Feldman1999-08-281-15/+26
| | | | | | | | 1. implement read-only ability 2. make it play nice with cdevsw (use cdevsw_remove() uon kldunload) Notes: svn path=/head/; revision=50490
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Use devtoname() to print dev_t's instead of casting them to long or u_longBruce Evans1999-08-231-6/+6
| | | | | | | for misprinting in %lx format. Notes: svn path=/head/; revision=50253
* Fix the breakage caused by hanging softc off dev_t. This is onlyPoul-Henning Kamp1999-08-231-7/+36
| | | | | | | a workaround. Notes: svn path=/head/; revision=50207
* Spring cleaning around strategy and disklabels/slices:Poul-Henning Kamp1999-08-141-5/+3
| | | | | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code. Notes: svn path=/head/; revision=49771
* Remove compiled in limit on number of devices.Poul-Henning Kamp1999-08-081-104/+29
| | | | Notes: svn path=/head/; revision=49548
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,Poul-Henning Kamp1999-08-081-2/+1
| | | | | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part. Notes: svn path=/head/; revision=49535
* Now a dev_t is a pointer to struct specinfo which is shared by all specdevPoul-Henning Kamp1999-07-201-41/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vnodes referencing this device. Details: cdevsw->d_parms has been removed, the specinfo is available now (== dev_t) and the driver should modify it directly when applicable, and the only driver doing so, does so: vn.c. I am not sure the logic in checking for "<" was right before, and it looks even less so now. An intial pool of 50 struct specinfo are depleted during early boot, after that malloc had better work. It is likely that fewer than 50 would do. Hashing is done from udev_t to dev_t with a prime number remainder hash, experiments show no better hash available for decent cost (MD5 is only marginally better) The prime number used should not be close to a power of two, we use 83 for now. Add new checkalias2() to get around the loss of info from dev2udev() in bdevvp(); The aliased vnodes are hung on a list straight of the dev_t, and speclisth[SPECSZ] is unused. The sharing of struct specinfo means that the v_specnext moves into the vnode which grows by 4 bytes. Don't use a VBLK dev_t which doesn't make sense in MFS, now we hang a dummy cdevsw on B/Cmaj 253 so that things look sane. Storage overhead from all of this is O(50k). Bump __FreeBSD_version to 400009 The next step will add the stuff needed so device-drivers can start to hang things from struct specinfo Notes: svn path=/head/; revision=48936
* This commit should be a extensive NO-OP:Poul-Henning Kamp1999-05-301-6/+21
| | | | | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors. Notes: svn path=/head/; revision=47625
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledPoul-Henning Kamp1999-05-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl). Notes: svn path=/head/; revision=47028
* Continue where Julian left off in July 1998:Poul-Henning Kamp1999-05-071-2/+2
| | | | | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.) Notes: svn path=/head/; revision=46635
* Introduce two functions: physread() and physwrite() and use these directlyPoul-Henning Kamp1999-05-071-16/+2
| | | | | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time) Notes: svn path=/head/; revision=46625