summaryrefslogtreecommitdiff
path: root/sys/dev/vn
Commit message (Collapse)AuthorAgeFilesLines
* This commit was manufactured by cvs2svn to create tagrelease/4.9.0_cvscvs2svn2003-10-271-1/+1
| | | | | | | 'RELENG_4_9_0_RELEASE'. This commit was manufactured to restore the state of the 4.9-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
* MFC B_NOWDRAIN. This required moving B_AUTOCHAINDONE from flags to xflagsMatthew Dillon2001-11-181-1/+1
| | | | | | | | (B_ -> BX_). Modify the VN device to use IO_NOWDRAIN (MFC from similar change in -current's MD device). Notes: svn path=/stable/4/; revision=86541
* Fix a long standing (since '94) error in VN related to file-backed VNMatthew Dillon2001-11-091-11/+4
| | | | | | | | | | | | devices. The VOP_ISLOCKED() call was completely bogus and could cause the VN device to issue VOP_READ() and VOP_WRITE() calls without obtaining the vnode lock if another process (e.g. like the buf_daemon or syncer) was holding the lock. This could potentially result in a corrupt filesystem. (MD in -current already does the right thing). Notes: svn path=/stable/4/; revision=86203
* Clean up properly when a `vn' module is kldunloaded to avoid panicsIan Dowse2001-03-261-1/+20
| | | | | | | | | | | | | | | | | later. We now call cdesw_remove() to unregister the device, NULL out any pointers to the vn_softc that exist in dev_t `si_drv1' fields, and perform a destroy_dev() corresponding to the initial make_dev(). This is not an MFC; vn(4) is no longer in -current. PR: kern/18270, i386/26049 Submitted by: peter.edwards@ireland.com, chervarium@nove.bg Reviewed by: phk Approved by: jkh Notes: svn path=/stable/4/; revision=74820
* MFC 1.112, zero out uio structure to avoid garbage pointers.Matthew Dillon2000-05-151-4/+9
| | | | | | | Tested by: "Sean O'Connell" <sean@stat.Duke.EDU> Notes: svn path=/stable/4/; revision=60608
* 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
* Suser() simplification:Poul-Henning Kamp1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code. Notes: svn path=/head/; revision=46112
* Submitted by: Matt Dillon <dillon@freebsd.org>Julian Elischer1999-03-141-214/+310
| | | | | | | | | | | | | | The old VN device broke in -4.x when the definition of B_PAGING changed. This patch fixes this plus implements additional capabilities. The new VN device can be backed by a file ( as per normal ), or it can be directly backed by swap. Due to dependencies in VM include files (on opt_xxx options) the new vn device cannot be a module yet. This will be fixed in a later commit. This commit delimitted by tags {PRE,POST}_MATT_VNDEV Notes: svn path=/head/; revision=44739
* The alternate B_PAGING path for vnstrategy() is used for VM faultsMatthew Dillon1999-02-011-1/+2
| | | | | | | | as well as swap I/O now. This path failed to properly set bp->b_resid on I/O completion. Notes: svn path=/head/; revision=43492
* Oops, got my #ifdef's mixed up. Fix an unused variable warning.Peter Wemm1999-01-231-1/+3
| | | | Notes: svn path=/head/; revision=43080
* Convert vn.c into a module (loadable and static).Peter Wemm1999-01-211-45/+53
| | | | Notes: svn path=/head/; revision=42985
* Remove the SLICE code.Søren Schmidt1998-09-141-325/+1
| | | | | | | | This clearly needs alot more thought, and we dont need this to hunt us down in 3.0-RELEASE. Notes: svn path=/head/; revision=39187
* Enable the vn device under DEVFS without SLICE.Søren Schmidt1998-09-121-4/+33
| | | | | | | This was apparently missed when all the #ifdef SLICE gunk was put in. Notes: svn path=/head/; revision=39104
* remove bdevsw arg from dsopen();Poul-Henning Kamp1998-08-231-2/+2
| | | | | | | | Forgotten by: julian Reviewed by: bde Notes: svn path=/head/; revision=38493
* Make struct buf->b_offset reflect the real byte offset which gotSøren Schmidt1998-08-191-1/+3
| | | | | | | | in via the uio struct. This enables device drivers to use != DEV_BSIZE blocking on devices with wierd sector/block sizes (ie CDROM's). Notes: svn path=/head/; revision=38438
* Added a flags arg to dsopen() and updated drivers. The DSO_ONESLICEBruce Evans1998-07-301-3/+3
| | | | | | | | | | | | | | and DSO_NOLABELS flags prevent searching for slices and labels respectively. Current drivers don't set these flags. When DSO_NOLABELS is set, the in-core label for the whole disk is cloned to create an in-core label for each slice. This gives the correct result (a good in-core label for the compatibility slice) if DSO_ONESLICE is set or only one slice is found, but usually gives broken labels otherwise, so DSO_ONESLICE should be set if DSO_NOLABELS is set. Notes: svn path=/head/; revision=37974
* SLICE probing becomes asynchronous. It can now be triggered byJulian Elischer1998-07-131-5/+2
| | | | | | | | | | | interupt level events. This needs a lot of cleanup, but has been working here for a month or two.. originally needed for CAM integration but that hasn't happenned yet. The probing state machines for each handler should be replaced by a more generic state-service. It's still quite messy in there.. Notes: svn path=/head/; revision=37616
* Fixed printf format errors.Bruce Evans1998-07-111-12/+15
| | | | Notes: svn path=/head/; revision=37555
* There is no such thing any more as "struct bdevsw".Julian Elischer1998-07-041-7/+25
| | | | | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind. Notes: svn path=/head/; revision=37389
* VOP_STRATEGY grows an (struct vnode *) argumentJulian Elischer1998-07-041-3/+3
| | | | | | | | | as the value in b_vp is often not really what you want. (and needs to be frobbed). more cleanups will follow this. Reviewed by: Bruce Evans <bde@freebsd.org> Notes: svn path=/head/; revision=37384
* Don't use a struct buf (malloc'd) without first initialising all the fieldsJulian Elischer1998-07-041-1/+5
| | | | | | | | to some known value! (probable cause of soft updates exploding with vn devices) Notes: svn path=/head/; revision=37366
* Fix another DEVFS/SLICE ioctl.Doug Rabson1998-06-071-2/+2
| | | | Notes: svn path=/head/; revision=36740