summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_dev.c
Commit message (Collapse)AuthorAgeFilesLines
* Pass the file->flags down to geom ioctl handlers.phk2004-12-121-1/+1
| | | | | | | | Reject certain ioctls if write permission is not indicated. Bump geom API version. Reported by: Ruben de Groot <mail25@bzerk.org>
* Don't set si_bsize_phys, nobody cares.phk2004-10-291-2/+0
|
* Give dev_strategy() an explict cdev argument in preparation for removingphk2004-10-291-2/+2
| | | | | | | | | | | buf->b-dev. Put a bio between the buf passed to dev_strategy() and the device driver strategy routine in order to not clobber fields in the buf. Assert copyright on vfs_bio.c and update copyright message to canonical text. There is no legal difference between John Dysons two-clause abbreviated BSD license and the canonical text.
* Use unit number allocation functions for GEOM minor numbers.phk2004-10-251-3/+18
|
* Retire si_stripesize and si_stripeoffset they will not be needed in cdevphk2004-10-251-2/+0
| | | | in the future.
* Don't call g_waitidle(), it happens automagically now.phk2004-10-231-3/+0
|
* Deny invalid I/O requests which comes from userland here, because laterpjd2004-09-271-0/+6
| | | | | | | we'll get a panic. MT5 candidate. Reviewed by: phk
* Assert topology is held in g_dev_getprovider().phk2004-09-241-3/+5
| | | | | Don't call devsw(). It is not necessary, and we do not need to hold dev_lock to compare the devsw pointer to our own since we do not dereference it.
* Tag all geom classes in the tree with a version number.phk2004-08-081-0/+1
|
* Use default method initialization on geoms.phk2004-08-081-1/+1
|
* Duplicate the securelevel check from spec_vnops.c here.phk2004-06-191-0/+11
|
* Reduce the thaumaturgical level of root filesystem mounts: Instead of usingphk2004-06-171-43/+0
| | | | | | | an otherwise redundant clone routine in geom_disk.c, mount a temporary DEVFS and do a proper lookup. Submitted by: thomas
* Second half of the dev_t cleanup.phk2004-06-171-1/+1
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-10/+10
| | | | Bump __FreeBSD_version accordingly.
* Device megapatch 4/6:phk2004-02-211-1/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Remove the absolute count g_access_abs() function since experience hasphk2004-02-121-3/+3
| | | | | | | | | | | | shown that it is not useful. Rename the relative count g_access_rel() function to g_access(), only the name has changed. Change all g_access_rel() calls in our CVS tree to call g_access() instead. Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source code compatibility.
* Add missing newline in printf.phk2004-01-231-1/+1
| | | | Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
* Remove KASSERT check for negative bio_offsets, add "normal" EIOphk2003-10-191-3/+0
| | | | error return for same.
* Assume that bp->bio_offset is correctly initialized.phk2003-10-121-1/+0
| | | | This fixes non-power-of-2 blocksize GEOM I/O.
* Make sure to return ENOIOCTL if the ioctl is not handled.phk2003-09-041-2/+2
|
* Simplify the ioctl handling in GEOM.phk2003-09-011-40/+5
| | | | | | | | | | | | | | | This replaces the current ioctl processing with a direct call path from geom_dev() where the ioctl arrives (from SPECFS) to any directly connected GEOM class. The inverse of the above is no longer supported. This is the situation were you have one or more intervening GEOM classes, for instance a BSDlabel on top of a MBR or PC98. If you want to issue MBR or PC98 specific ioctls, you will need to issue them on a MBR or PC98 providers. This paves the way for inviting CD's, FD's and other special cases inside GEOM.
* Add the new g_dev_getprovider() function, the swap_pager needs it now.phk2003-08-301-0/+14
| | | | Spotted by: mr
* Replace a panic with a .1Hz retry loop.phk2003-08-131-1/+10
| | | | Not a perfect solution, but far cheaper than one.
* Kick Giant compatibility one layer up.phk2003-08-021-9/+1
|
* Use __FBSDID().obrien2003-06-111-2/+3
| | | | Approved by: phk
* Improve the root-dev prompt facility for printing devices which couldphk2003-06-071-8/+6
| | | | possibly be a root filesystem.
* Wait for everything to settle before we try to print the list ofphk2003-06-071-0/+1
| | | | geom devices.
* Remove unused variables.phk2003-05-311-6/+1
| | | | Found by: FlexeLint
* Remove the G_CLASS_INITIALIZER, we do not need it anymore.phk2003-05-311-1/+0
|
* When a GEOM (/dev-)device is closed and we find that I/O requests arephk2003-05-091-3/+15
| | | | | | | | | | | | still outstanding, give them a chance to complete. If after 10 seconds we still find outstanding I/O requests, complete the close with a console warning that the system is likely to panic later on. This is a workaround for umount -f not quite doing the right thing. Approved by: re/scottl
* Back out all the stuff that didn't belong in the last commit.phk2003-05-021-3/+3
|
* Use g_slice_spoiled() rather than g_std_spoiled().phk2003-05-021-3/+3
| | | | Remember to free the buffer we got from g_read_data().
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-1/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Properly handle races between open/close and orphan.phk2003-04-021-10/+34
| | | | | | | KASSERT the race between close and strategy, it is an error in the upper echelons if this happens, Add XXX: comment explaining why the ioctl/orphan race is not closed.
* Premptively change initializations of struct g_class to use C99phk2003-03-241-3/+2
| | | | | sparse struct initializations before we extend the struct with new OAM related member functions.
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-181-1/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* Remove unneeded #include of geom_stats.hphk2003-03-091-1/+0
|
* When a DEV class consumer is orphan'ed we need to wait for all thephk2003-03-091-11/+20
| | | | | | | | | | outstanding requests to return before we unravel the mesh. It is very important that the stuff below us plays nice and don't overlook a couple of outstanding bio's, because until they remember the geom event thread is blocked. At an expense in code here this could be made more robust, but I actually _want_ a robust failure in this case so any offending drivers can be fixed.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-14/+9
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* NO_GEOM cleanup:phk2003-03-021-14/+1
| | | | Remove cdevsw->d_psize() implementation, we don't need it any more.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Advertise MAXPHYS upwards, we will split as necessary before we get to thephk2003-02-111-1/+1
| | | | bottom of things.
* Better names for struct disk elements: d_maxsize, d_stripeoffsetphk2003-02-111-0/+2
| | | | | | | | | | | and d_stripesisze; Introduce si_stripesize and si_stripeoffset in struct cdev so we can make the visible to clustering code. Add stripesize and stripeoffset to providers. DTRT with stripesize and stripeoffset in various places in GEOM.
* Use the SI_CANDELETE flag on the dev_t rather than the D_CANFREE flagphk2003-02-111-1/+3
| | | | on the cdevsw to determine ability to handle the BIO_DELETE request.
* Move the g_stat struct to its own .h file, we will export it to other code.phk2003-02-081-1/+2
| | | | | | | | | | | | | | | | | | Insted of embedding a struct g_stat in consumers and providers, merely include a pointer. Remove a couple of <sys/time.h> includes now unneeded. Add a special allocator for struct g_stat. This allocator will allocate entire pages and hand out g_stat functions from there. The "id" field indicates free/used status. Add "/dev/geom.stats" device driver whic exports the pages from the allocator to userland with mmap(2) in read-only mode. This mmap(2) interface should be considered a non-public interface and the functions in libgeom (not yet committed) should be used to access the statistics data.
* Move #defines of major/minor to internal header file so other bits canphk2003-02-081-4/+2
| | | | share and coordinate with geom_dev.
* Commit the correct copy of the g_stat structure.phk2003-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add debug.sizeof.g_stat sysctl. Set the id field of the g_stat when we create consumers and providers. Remove biocount from consumer, we will use the counters in the g_stat structure instead. Replace one field which will need to be atomically manipulated with two fields which will not (stat.nop and stat.nend). Change add companion field to bio_children: bio_inbed for the exact same reason. Don't output the biocount in the confdot output. Fix KASSERT in g_io_request(). Add sysctl kern.geom.collectstats defaulting to off. Collect the following raw statistics conditioned on this sysctl: for each consumer and provider { total number of operations started. total number of operations completed. time last operation completed. sum of idle-time. for each of BIO_READ, BIO_WRITE and BIO_DELETE { number of operations completed. number of bytes completed. number of ENOMEM errors. number of other errors. sum of transaction time. } } API for getting hold of these statistics data not included yet.
* Rename bio_linkage to the more obvious bio_parent.phk2003-02-071-1/+1
| | | | Add bio_t0 timestamp, and include <sys/time.h> where needed
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Now that we have non-geom_disk based drivers, we need to cover for those,phk2003-01-141-3/+4
| | | | | | in case they return EOPNOTSUPP on an ioctl. Found by: jhb
OpenPOWER on IntegriCloud