summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_diskslice.c
Commit message (Collapse)AuthorAgeFilesLines
* NO_GEOM cleanup: retire to attic.phk2003-01-301-940/+0
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-5/+5
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* #ifdef NO_GEOM these files entirely. When NO_GEOM is removed as anphk2003-01-191-0/+2
| | | | option the files can be removed.
* Remove the unused DSO_* options.phk2003-01-171-31/+6
|
* Move dkmodpart() from subr_diskslice.c to subr_disklabel.c.phk2003-01-171-6/+0
|
* Indent properly.phk2002-12-171-1/+2
|
* Use strlcpy() instead of strncpy() to copy NUL terminated stringsrobert2002-10-171-2/+2
| | | | for safety and consistency.
* Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:phk2002-10-011-0/+5
| | | | | | | | | | | | | | | | Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h. These two new copies are still intact copies of disklabel.h and therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them in programs which already include <sys.disklabel.h> is currently a no-op. This commit adds a number of such #includes. Once I have verified that I have fixed all the places which need fixing, I will commit the updated versions of the three #include files. Sponsored by: DARPA & NAI Labs.
* Remove unused variable.phk2002-09-201-1/+0
|
* Retire now unused DIOCGDVIRGIN kludge.phk2002-09-201-33/+0
| | | | Sponsored by: DARPA & NAI Labs.
* Fix DIOCGMEDIASIZE and DIOCGSECTORSIZE ioctls to work for allkan2002-07-231-13/+13
| | | | | | | | | | disk devices. This fixes the problem with these ioctls returning EINVAL for plain slice devices with no disklabel on them. The patch incorporates improvements and style fixes from BDE. Reviewed by: bde Approved by: obrien (mentor)
* This commit adds basic support for the UFS2 filesystem. The UFS2mckusick2002-06-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesystem expands the inode to 256 bytes to make space for 64-bit block pointers. It also adds a file-creation time field, an ability to use jumbo blocks per inode to allow extent like pointer density, and space for extended attributes (up to twice the filesystem block size worth of attributes, e.g., on a 16K filesystem, there is space for 32K of attributes). UFS2 fully supports and runs existing UFS1 filesystems. New filesystems built using newfs can be built in either UFS1 or UFS2 format using the -O option. In this commit UFS1 is the default format, so if you want to build UFS2 format filesystems, you must specify -O 2. This default will be changed to UFS2 when UFS2 proves itself to be stable. In this commit the boot code for reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c) as there is insufficient space in the boot block. Once the size of the boot block is increased, this code can be defined. Things to note: the definition of SBSIZE has changed to SBLOCKSIZE. The header file <ufs/ufs/dinode.h> must be included before <ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and ufs_lbn_t. Still TODO: Verify that the first level bootstraps work for all the architectures. Convert the utility ffsinfo to understand UFS2 and test growfs. Add support for the extended attribute storage. Update soft updates to ensure integrity of extended attribute storage. Switch the current extended attribute interfaces to use the extended attribute storage. Add the extent like functionality (framework is there, but is currently never used). Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@freebsd.org>
* Fixed overflow in the bounds checking in dscheck(). It assumed thatbde2002-06-061-4/+4
| | | | | | | | daadr_t is no larger than a long, and some other relatively harmless things (*blush*). Overflow for subtracting a daddr_t from a u_long caused "truncation" of the i/o for attempts to access blocks beyond the end of the actually cause expansion of the i/o to a preposterous size.
* Retire the bogus uses of the disklabel field d_sbsize and begin tophk2002-05-121-5/+1
| | | | | | | initialize it to zero so we don't have to have everbody and their aunt including FFS specific header files. Sponsored by: DARPA & NAI Labs.
* Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.phk2002-04-081-0/+1
| | | | Sponsored by: DARPA & NAI Labs
* Retire the bogus ioctl DIOCGPART in toto.phk2002-04-021-8/+0
| | | | | | | Once again we can notice that badly thought out hacks ferment and infect far more code than initially expected. Sponsored by: DARPA and NAI Labs.
* Implement the two "GEOM" ioctls DIOCGSECTORSIZE and DIOCGMEDIASIZE forphk2002-03-311-0/+13
| | | | | | | the non-GEOM code as well. This simplifies the the kernel-dumping and disk-management tools as less compatibility cruft will be needed. Sponsored by: DARPA and NAI Labs.
* Remove __P.alfred2002-03-191-12/+12
|
* Delete "notyet" code before it becomes "ohh no" code.phk2002-03-091-8/+0
|
* Uninlined most of the bloated inline functions in <sys/disklabel.h>. Somebde2002-01-171-0/+18
| | | | of them need to become even larger to support devfs.
* KSE Milestone 2julian2001-09-121-2/+2
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Create a general facility for making dev_t's depend on anotherphk2001-05-261-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | dev_t. The dev_depends(dev_t, dev_t) function is for tying them to each other. When destroy_dev() is called on a dev_t, all dev_t's depending on it will also be destroyed (depth first order). Rewrite the make_dev_alias() to use this dependency facility. kern/subr_disk.c: Make the disk mini-layer use dependencies to make sure all relevant dev_t's are removed when the disk disappears. Make the disk mini-layer precreate some magic sub devices which the disk/slice/label code expects to be there. kern/subr_disklabel.c: Remove some now unneeded variables. kern/subr_diskmbr.c: Remove some ancient, commented out code. kern/subr_diskslice.c: Minor cleanup. Use name from dev_t instead of dsname()
* Don't rely on cdevsw_add() when we hack about with dev_t's.phk2001-05-241-0/+2
|
* Add a new ioctl for doing virgin disklabels.jkh2000-10-311-0/+34
| | | | Submitted by: dillon
* Write support for the cd(4) driver.ken2000-10-301-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows writing to DVD-RAM, PD and similar drives that probe as CD devices. Note that these are randomly writeable devices, not sequential-only devices like CD-R drives, which are supported by cdrecord. Add a new flag value for dsopen(), DSO_COMPATLABEL. The cd(4) driver now uses this flag instead of the DSO_NOLABELS flag. The DSO_NOLABELS always used a "fake" disklabel for the entire disk, provided by the caller. With the DSO_COMPATLABEL flag, dsopen() will first search the media for a label, and if it finds a label, it will use that label. Otherwise it will use the fake disklabel provided by the caller. This provides backwards compatibility, since we will still have labels for ISO9660 media. It also provides new functionality, since you can now have a regular BSD disklabel on read-only media, or on writeable media (e.g. DVD-RAM). Bruce and I both think that we should eventually (in a few years) get away from using disklabels for ISO9660 media, and just use the whole disk device (/dev/cd0). At that point disklabel handling in the cd(4) driver could follow the "normal" model, as used in the da(4) driver. Also, clean up the path in a couple of places in cdregister(). (Thanks to Nick Hibma for catching that bug.) Reviewed by: bde
* Convert all users of fldoff() to offsetof(). fldoff() is badphk2000-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-021-9/+1
| | | | | | | | | | | | | | | | | | 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.
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-201-108/+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
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-1/+1
| | | | | | | | | | | | | | | <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
* Give struct bio it's own call back mechanism.phk2000-05-011-17/+9
|
* Remove unused variable.mjacob2000-04-261-1/+0
|
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-04-151-39/+41
| | | | | | | | | | 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
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-021-2/+2
| | | | | | | | | | | | | (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.
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-201-7/+5
| | | | | | | | | | | | | | | | | | | | | 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.
* Fixed a memory leak for slices with an (unsupported) bad sector table.bde2000-01-281-1/+2
| | | | Broken in: rev.1.80.
* Cleanup some more remaining bdev fluff.phk2000-01-161-70/+18
|
* Remove BAD144 support, it has already been disabled for some time.phk1999-12-081-77/+4
|
* Add missing 't' in printf message.phk1999-09-251-1/+1
|
* Add a DSO_BAD144 flag which indicates that the driver actually understandphk1999-09-201-1/+9
| | | | | | | | BAD144 handling. Reject DIOCSBAD and labels with BAD144 tables if the driver cannot grok it. Reviewed by: bde
* Const poisoning from d_name.bde1999-09-131-6/+5
| | | | Fixed some style bugs in recent changes.
* Changes to centralise the default blocksize behaviour.julian1999-09-091-2/+0
| | | | | | More likely to follow. Submitted by: phk@freebsd.org
* Fix a warning for the !DEVFS case.peter1999-09-031-2/+4
|
* Revert a bunch of contraversial changes by PHK. Afterjulian1999-09-031-0/+1
| | | | | | | | | | 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.
* Use "multiple 4 char outdent until no wrap" rather than ANSI stringphk1999-09-011-7/+7
| | | | | | | concatenation to preserve K&R compatibility. Requested by: bde Terminology by: grog
* Include "dscheck" and device name in all messages from dscheck().phk1999-08-311-7/+13
|
* Make bdev userland access work like cdev userland access unlessphk1999-08-301-1/+0
| | | | | | | | | | 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 before it kills Matt :-) Use the specfs routines rather having cloned copies in devfs.
* initialize si_bsize_phys from what the drive told us.phk1999-08-291-1/+1
|
* We don't need to pass the diskname argument all over the diskslice/labelphk1999-08-281-35/+27
| | | | code, we can find the name from any convenient dev_t
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-1/+5
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
OpenPOWER on IntegriCloud