Commit Graph

171 Commits

Author SHA1 Message Date
jdolecek 1af402fe8a introduce DKCACHE_COMBINE() macro - it combines the flags in a way that
all common flags are retained, and flags regarding write cache are preserved
if either of the devices has it; callers can thus rely on write cache not
being possible to be used when both flags are missing

use the new macro for ccd(4)
2017-04-05 18:34:56 +00:00
jdolecek 22308629ce support DIOCGCACHE - result is intersection of flags returned by underlying
devices; devices can't be added or removed, so the feature flags remain
static

add support for DIOCGSTRATEGY while here, mainly to make dkctl(8) output neater
2017-03-30 16:50:32 +00:00
mlelstv ba576b71a7 Enhance disk metrics by calculating a weighted sum that is incremented
by the number of concurrent I/O requests. Also introduce a new disk_wait()
function to measure requests waiting in a bufq.
iostat -y now reports data about waiting and active requests.

So far only drivers using dksubr and dk, ccd, wd and xbd collect data about
waiting requests.
2017-03-05 23:07:12 +00:00
pgoyette e38abff020 Avoid calling bufq_free() from critical section. 2016-11-20 02:34:27 +00:00
pgoyette aeebcff218 Create the kern.ccd sysctl sub-tree when built as a module. Even though
the contents of the sub-tree are all structures, and thus not displayed
via sysctl(8), the info is potentially useful to programs.  (For example,
ccdconfig could use this to determine how many units are available.)

The sub-tree is already available when the module is included as built-in
module.
2016-08-07 02:40:41 +00:00
christos 8d10f96266 Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
2015-12-08 20:36:14 +00:00
christos e7ae23fd9e include "ioconf.h" to get the 'void <driver>attach(int count);' prototype. 2015-08-20 14:40:16 +00:00
skrll 216c99d88d Trailing whitespace. 2015-07-21 21:42:15 +00:00
christos ddeabcf2cb initialized sc_unit (from Riastradh)
XXX: pullup-7
2015-06-18 17:21:55 +00:00
christos c182898b0d We have three sets of DTYPE_ constants in the kernel:
altq		Drop 		Type
	disklabel	Disk 		Type
	file		Descriptor	Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
2015-01-02 19:42:05 +00:00
christos c60db2e923 make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
2014-12-31 19:52:04 +00:00
christos 3be6bb2414 Centralize wedge ioctls in disk_ioctl. 2014-12-31 17:06:48 +00:00
christos 37efed977c destroy the pool and the mutex when detaching. 2014-12-30 20:57:37 +00:00
christos ef78102379 - only create ccd's when we ask them to be created.
- keep track of the number of active ccd's so that we don't modunload and
  crash
- fix formatting.
- don't attach 4, the argument is not used.
2014-12-30 20:29:42 +00:00
mlelstv c5ff2ab77e Fix locking error.
Clear EPASSTHROUGH return value from disk_ioctl.
Add missing wedge ioctls.
2014-12-30 19:11:05 +00:00
jnemeth 026ad6683b Slowly bring this thing kicking and screaming into the 21st century:
- use struct disk_geom
- add wedge support
2014-12-30 12:42:16 +00:00
christos 75320acf84 call disk_ioctl. 2014-12-30 02:21:10 +00:00
mlelstv 49e3024a88 No longer warn about differences bewteen disk size and total sector count
in disklabel when the latter is just clamped to the maximum.
2014-10-11 12:36:25 +00:00
mlelstv 53385cb9cd clamp total number of sectors to UINT32_MAX instead of providing the
lower 32bit of the 64bit number.
2014-10-11 12:01:27 +00:00
sborrill 7d706cf73d Switch size_t to uint64_t in appropriate places to ensure that ccd(4) works
with component and total sizes of > 2TB.
Add COMPAT_60 code for platforms where this alters userland-accessible
structures.
Make kernel print device information when a ccd configured.
Fix some typos in comments.
2014-08-16 19:27:27 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland 8c70ef39af Add d_discard to all struct bdevsw instances I could find.
I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
2014-07-25 08:02:18 +00:00
hannken 292a0c7f1d Change dk_lookup() to return an anonymous vnode not associated with
any file system.  Change all consumers of dk_lookup() to get the
device from "v_rdev" instead of VOP_GETATTR() as specfs does not
support VOP_GETATTR().  Devices obtained with dk_lookup() will no
longer disappear on forced unmounts.

Fix for PR kern/48849 (root mirror raid fails on shutdown)

Welcome to 6.99.44
2014-06-14 07:39:00 +00:00
joerg 552522025c Don't destroy locked mutex. Don't access freed memory. 2014-04-06 00:56:39 +00:00
pooka 4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
pgoyette 8682ae0dd0 ccd module also needs dk_subr 2013-12-28 19:44:41 +00:00
martin cd2a35a0c5 #ifdef a few variable declarations/initializations to match their use 2013-09-12 12:22:40 +00:00
christos b08b65c634 - no limit on the number of ccd devices.
- provide sysctl for getting information.
2013-04-27 17:13:32 +00:00
christos e839ec30fc use getdisksize 2011-11-13 23:02:46 +00:00
hannken 2cc7a01f10 Change the vnode locking protocol of VOP_GETATTR() to request at least
a shared lock.  Make all calls outside of file systems respect it.

The calls from file systems need review.

No objections from tech-kern.
2011-10-14 09:23:28 +00:00
joerg 258624699d Fix memset usage. 2011-07-04 16:06:17 +00:00
jruoho b4a3a8f3ec Adjust the #ifdefs such that ccd(4) and cgd(4) show in
modstat(8) even if built into the kernel.
2011-06-21 06:23:38 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
rmind 9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +00:00
dholland 0a4a6fb035 Fix previous, was all wrong. noticed by enami. 2010-11-19 09:11:45 +00:00
dholland 8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
uebayasi 19b39d64b4 Include uvm/uvm_extern.h to access uvmexp. gtmpsc.c doesn't need
uvm(9) API at all.
2010-11-14 03:49:52 +00:00
haad 7147ed320b Add work in support for compiling ccd and cgd drivers as a modules. I forgot
to committ when I have written device module autoloading stuff.
2009-06-05 19:21:02 +00:00
ad 481ff5ace4 Fix problems with ccd:
- Pending async I/O was tossed on unconfigure (should not happen, but..)
- It could exhaust memory under heavy I/O load.
- If memory allocation failed, disk transfers could stall.
- v_numoutput was updated without v_interlock held.

Additionally:

- Make it MPSAFE.
- Use kmem_alloc().
2009-04-04 08:29:39 +00:00
yamt 70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
cegger 08ebead94e make this compile 2009-01-11 09:51:38 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
hannken 6a545682ed ccdbuffer(): add missing initialization of new bufs b_objlock. 2008-02-02 10:40:50 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
ad eb171eaaa7 It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:50:17 +00:00