The NetBSD Project

CVS log for src/sys/kern/subr_disk.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.137 / (download) - annotate - [select for diffs], Tue May 9 12:04:04 2023 UTC (11 months, 1 week ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored)

ioctl(DIOCRMWEDGES): Delete only idle wedges.

Don't forcibly delete busy wedges.

Reported-by: syzbot+e46f31fe56e04f567d88@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=8a00fd7f2e7459748d7a274098180a4708ff0f61

Fixes accidental destruction of the busy wedge that the root file
system is mounted on, triggered by syzbot's ioctl(DIOCRMWEDGES).

Revision 1.136 / (download) - annotate - [select for diffs], Sat Apr 22 11:58:01 2023 UTC (11 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.135: +10 -5 lines
Diff to previous 1.135 (colored)

disk(9): Fix missing unlock in error branch in previous change.

Reported-by: syzbot+870665adaf8911c0d94d@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=a4ae17cf66b5bb999182ae77fd3c7ad9ad18c891

Revision 1.135 / (download) - annotate - [select for diffs], Fri Apr 21 18:30:04 2023 UTC (11 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.134: +22 -5 lines
Diff to previous 1.134 (colored)

disk(9): Fix use-after-free race with concurrent disk_set_info.

This can happen with dk(4), which allows wedges to have their size
increased without destroying and recreating the device instance.

Drivers which allow concurrent disk_set_info and disk_ioctl must
serialize disk_set_info with dk_openlock.

Revision 1.134 / (download) - annotate - [select for diffs], Mon Mar 28 12:33:59 2022 UTC (2 years ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Changes since 1.133: +9 -2 lines
Diff to previous 1.133 (colored)

disk(9): New function disklabel_dev_unit.

Maps a dev_t like wd3e to an autoconf instance number like 3, with no
partition.  Same as DISKUNIT macro, but is a symbol whose pointer can
be taken.  Meant for use with struct bdevsw, cdevsw::d_devtounit.

Revision 1.133 / (download) - annotate - [select for diffs], Mon May 17 08:50:36 2021 UTC (2 years, 11 months ago) by mrg
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Changes since 1.132: +2 -25 lines
Diff to previous 1.132 (colored)

move bi-endian disklabel support from the kernel and libsa into libkern.

- dkcksum() and dkcksum_sized() move from subr_disk.c and from
  libsa into libkern/dkcksum.c (which is missing _sized() version),
  using the version from usr.sbin/disklabel.

- swap_disklabel() moves from subr_disk_mbr.c into libkern, now called
  disklabel_swap().  (the sh3 version should be updated to use this.)

- DISKLABEL_EI becomes a first-class option with opt_disklabel.h.

- add libkern.h to libsa/disklabel.c.

this enables future work for bi-endian libsa/ufs.c (relevant for ffsv1,
ffsv2, lfsv1, and lfsv2), as well as making it possible for ports not
using subr_disk_mbr.c to include bi-endian disklabel support (which,
afaict, includes any disk on mbr-supporting platforms that do not have
an mbr as well as disklabel.)

builds successsfully on: alpha, i386, amd64, sun2, sun3, evbarm64,
evbarm64-eb, sparc, and sparc64.  tested in anita on i386 and sparc,
testing in hardware on evbarm64*.

Revision 1.132 / (download) - annotate - [select for diffs], Sat Oct 17 09:42:35 2020 UTC (3 years, 6 months ago) by mlelstv
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_staticlib_x-base
Branch point for: thorpej-i2c-spi-conf, cjep_staticlib_x
Changes since 1.131: +8 -12 lines
Diff to previous 1.131 (colored)

Attach disk info even for zero sized disks.
Slight refactoring.

Revision 1.131 / (download) - annotate - [select for diffs], Thu Jun 11 02:32:06 2020 UTC (3 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.130: +3 -3 lines
Diff to previous 1.130 (colored)

Update for proplib(3) API changes.

Revision 1.130 / (download) - annotate - [select for diffs], Fri Mar 27 11:13:57 2020 UTC (4 years ago) by mlelstv
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Changes since 1.129: +6 -2 lines
Diff to previous 1.129 (colored)

Avoid division by zero if label isn't valid.

Revision 1.129 / (download) - annotate - [select for diffs], Mon Sep 30 23:23:59 2019 UTC (4 years, 6 months ago) by cnst
Branch: MAIN
CVS Tags: phil-wifi-20191119, is-mlppp-base, is-mlppp, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (colored)

kern/subr_disk: bounds_check_with_label: really protect against div by zero

Solves kernel panic in NetBSD 8.1 amd64 on VirtualBox 6.0.12 r133076.

Triggered with an NVMe controller without any actual discs behind it:

nvme0 at pci0 dev 14 function 0: vendor 80ee product 4e56 (rev. 0x00)
nvme0: NVMe 1.2
nvme0: interrupting at ioapic0 pin 22
nvme0: ORCL-VBOX-NVME-VER12, firmware 1.0, serial VB1234-56789
ld0 at nvme0 nsid 1
ld0: 0, 0 cyl, 16 head, 63 sec, 1 bytes/sect x 0 sectors

Code path is reached 4 times during normal boot, each time after wd0a
is already mounted; this patch avoids a crash with a dirty filesystem.

Revision 1.128 / (download) - annotate - [select for diffs], Wed May 22 08:47:02 2019 UTC (4 years, 10 months ago) by hannken
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Branch point for: netbsd-9
Changes since 1.127: +13 -2 lines
Diff to previous 1.127 (colored)

Implement disk_rename()/iostat_rename() to rename a disk.

Use it from zvol_rename_minor() when renaming a ZVOL.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Apr 4 20:19:07 2019 UTC (5 years ago) by christos
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.126: +2 -74 lines
Diff to previous 1.126 (colored)

move setdisklabel(9) into a separate file.

Revision 1.126 / (download) - annotate - [select for diffs], Thu Apr 4 11:49:06 2019 UTC (5 years ago) by christos
Branch: MAIN
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored)

one more __func__

Revision 1.125 / (download) - annotate - [select for diffs], Thu Apr 4 07:09:55 2019 UTC (5 years ago) by martin
Branch: MAIN
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

Make the DEBUG version compile

Revision 1.124 / (download) - annotate - [select for diffs], Wed Apr 3 22:10:52 2019 UTC (5 years ago) by christos
Branch: MAIN
Changes since 1.123: +74 -2 lines
Diff to previous 1.123 (colored)

centralize setdisklabel(9)

Revision 1.123 / (download) - annotate - [select for diffs], Wed Mar 27 19:13:33 2019 UTC (5 years ago) by martin
Branch: MAIN
Changes since 1.122: +9 -2 lines
Diff to previous 1.122 (colored)

Add a disk ioctl DIOCRMWEDGES to remove all wedges of a given disk
(if not busy).

Revision 1.122 / (download) - annotate - [select for diffs], Wed Mar 7 21:13:24 2018 UTC (6 years, 1 month ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi
Changes since 1.121: +3 -3 lines
Diff to previous 1.121 (colored)


Fix typo in comment (s/is/if/) - NFC.

Revision 1.121 / (download) - annotate - [select for diffs], Fri Oct 27 12:25:15 2017 UTC (6 years, 5 months ago) by joerg
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, pgoyette-compat-base
Branch point for: pgoyette-compat
Changes since 1.120: +1 -1 lines
Diff to previous 1.120 (colored)

Revert printf return value change.

Revision 1.120 / (download) - annotate - [select for diffs], Fri Oct 27 09:59:16 2017 UTC (6 years, 5 months ago) by utkarsh009
Branch: MAIN
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored)

[syzkaller] Cast all the printf's to (void *)
> as a result of new printf(9) declaration.

Revision 1.119 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:13 2017 UTC (6 years, 10 months ago) by chs
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Changes since 1.118: +2 -4 lines
Diff to previous 1.118 (colored)

remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Mar 5 23:07:12 2017 UTC (7 years, 1 month ago) by mlelstv
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Changes since 1.117: +12 -2 lines
Diff to previous 1.117 (colored)

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.

Revision 1.117 / (download) - annotate - [select for diffs], Tue Feb 28 00:33:36 2017 UTC (7 years, 1 month ago) by jakllsch
Branch: MAIN
Changes since 1.116: +3 -3 lines
Diff to previous 1.116 (colored)

pi_bsize must be at least pi_secsize

Allows block device accesses to 4KiB logical sector disks to function on the
vast majority of ports with 2KiB BLKDEV_IOSIZE.

Revision 1.116 / (download) - annotate - [select for diffs], Wed Jan 6 00:22:30 2016 UTC (8 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, localcount-20160914, bouyer-socketcan-base
Branch point for: pgoyette-localcount, bouyer-socketcan
Changes since 1.115: +27 -6 lines
Diff to previous 1.115 (colored)

print the disklabel information on error if DIAGNOSTIC.

Revision 1.115 / (download) - annotate - [select for diffs], Tue Dec 8 20:36:15 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226
Changes since 1.114: +46 -7 lines
Diff to previous 1.114 (colored)

Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.

Revision 1.114 / (download) - annotate - [select for diffs], Sat Nov 28 14:36:00 2015 UTC (8 years, 4 months ago) by mlelstv
Branch: MAIN
Changes since 1.113: +3 -3 lines
Diff to previous 1.113 (colored)

Handle sector sizes other than DEV_BSIZE when reading labels.

Revision 1.113 / (download) - annotate - [select for diffs], Thu May 14 17:31:24 2015 UTC (8 years, 11 months ago) by chs
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606
Changes since 1.112: +28 -5 lines
Diff to previous 1.112 (colored)

in bounds_check_with_*, reject negative block numbers and avoid
a potential overflow in calculating the size of the request.

Revision 1.112 / (download) - annotate - [select for diffs], Tue May 5 22:09:24 2015 UTC (8 years, 11 months ago) by mlelstv
Branch: MAIN
Changes since 1.111: +12 -12 lines
Diff to previous 1.111 (colored)

Always fixup zero sector size, even when other geometry values are invalid.

Revision 1.111 / (download) - annotate - [select for diffs], Fri Jan 2 01:14:22 2015 UTC (9 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.110: +5 -3 lines
Diff to previous 1.110 (colored)

- Use NODEV instead of 0
- Return EBUSY if there was no label

Revision 1.110 / (download) - annotate - [select for diffs], Wed Dec 31 20:13:41 2014 UTC (9 years, 3 months ago) by mlelstv
Branch: MAIN
Changes since 1.109: +2 -15 lines
Diff to previous 1.109 (colored)

Retire disk_blocksize().

Revision 1.109 / (download) - annotate - [select for diffs], Wed Dec 31 19:58:59 2014 UTC (9 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.108: +24 -22 lines
Diff to previous 1.108 (colored)

Mention which ioctls need to move to dk_ioctl, and don't allow wedges on
wedges.

Revision 1.108 / (download) - annotate - [select for diffs], Wed Dec 31 19:52:06 2014 UTC (9 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.107: +33 -3 lines
Diff to previous 1.107 (colored)

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.

Revision 1.107 / (download) - annotate - [select for diffs], Wed Dec 31 17:06:49 2014 UTC (9 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.106: +40 -23 lines
Diff to previous 1.106 (colored)

Centralize wedge ioctls in disk_ioctl.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Dec 31 08:24:51 2014 UTC (9 years, 3 months ago) by mlelstv
Branch: MAIN
Changes since 1.105: +9 -3 lines
Diff to previous 1.105 (colored)

disk_blocksize and disk_set_info relay the same information
to the disk subsystem.

Make disk_set_info also set blocksize shift values.
Remove every call to disk_blocksize.

Keep disk_blocksize for ABI compatibility, make it also set dg_secsize.

Revision 1.105 / (download) - annotate - [select for diffs], Mon Dec 29 18:54:19 2014 UTC (9 years, 3 months ago) by mlelstv
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored)

clear error for new ioctls.

Revision 1.104 / (download) - annotate - [select for diffs], Mon Dec 29 18:41:20 2014 UTC (9 years, 3 months ago) by mlelstv
Branch: MAIN
Changes since 1.103: +11 -2 lines
Diff to previous 1.103 (colored)

Implement DIOCGMEDIASIZE and DIOCGSECTORSIZE from FreeBSD.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Oct 19 22:36:57 2013 UTC (10 years, 6 months ago) by mlelstv
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base, netbsd-7-base
Branch point for: nick-nhusb, netbsd-7
Changes since 1.102: +3 -3 lines
Diff to previous 1.102 (colored)

use 64bit arithmetic to compute sectors-per-unit

Revision 1.102 / (download) - annotate - [select for diffs], Wed May 29 00:47:49 2013 UTC (10 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.101: +83 -2 lines
Diff to previous 1.101 (colored)

phase 1 of disk geometry cleanup:
	- centralize the geometry -> plist code so that we don't have
	  n useless copies of it.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Feb 9 00:31:21 2013 UTC (11 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: khorben-n900, agc-symver-base, agc-symver
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

printflike maintenance.

Revision 1.100 / (download) - annotate - [select for diffs], Thu Oct 14 00:47:16 2010 UTC (13 years, 6 months ago) by mrg
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, uebayasi-xip-base4, uebayasi-xip-base3, rmind-uvmplock-nbase, rmind-uvmplock-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.99: +4 -4 lines
Diff to previous 1.99 (colored)

add some (uint64_t) casts so avoid 32 bit overflows.  this fixes my
3TB disk with 4KB sectors and disklabel (which looks like it would
work upto 16TB.)

idea from mlelstv@.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Nov 28 22:38:07 2009 UTC (14 years, 4 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.98: +5 -5 lines
Diff to previous 1.98 (colored)

When truncating a request in bounds_check_with_mediasize() multiply
by the provided sector size instead of 512.
Fixes last bit of PR/31565

Revision 1.98 / (download) - annotate - [select for diffs], Fri Nov 27 11:23:50 2009 UTC (14 years, 4 months ago) by tsutsui
Branch: MAIN
Changes since 1.97: +8 -7 lines
Diff to previous 1.97 (colored)

u_short -> uint16_t, some KNF.

Revision 1.97 / (download) - annotate - [select for diffs], Wed May 20 03:26:21 2009 UTC (14 years, 11 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base, jym-xensuspend-nbase
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored)

On second thought, let's call disk_predetach() disk_begindetach().
Verbs are good.

Revision 1.96 / (download) - annotate - [select for diffs], Tue May 19 23:42:05 2009 UTC (14 years, 11 months ago) by dyoung
Branch: MAIN
Changes since 1.95: +21 -2 lines
Diff to previous 1.95 (colored)

Encapsulate the checks that I do before detaching a disk(9) provider
in a pre-detachment routine, disk_predetach().

Revision 1.95 / (download) - annotate - [select for diffs], Sat Apr 4 07:30:10 2009 UTC (15 years ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.94: +13 -3 lines
Diff to previous 1.94 (colored)

Add disk_isbusy(), iostat_isbusy().

Revision 1.94 / (download) - annotate - [select for diffs], Thu Jan 22 14:38:35 2009 UTC (15 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Branch point for: jym-xensuspend
Changes since 1.93: +9 -14 lines
Diff to previous 1.93 (colored)

malloc -> kmem_alloc

Revision 1.93 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:04 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, netbsd-5-base, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, mjf-devfs2-base, matt-mips64-base2, hpcarm-cleanup-nbase, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.92: +2 -9 lines
Diff to previous 1.92 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.92 / (download) - annotate - [select for diffs], Thu Feb 28 04:55:47 2008 UTC (16 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp
Changes since 1.91: +3 -3 lines
Diff to previous 1.91 (colored)

constify dkdriver

Revision 1.91 / (download) - annotate - [select for diffs], Thu Jan 31 18:30:55 2008 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.90: +3 -3 lines
Diff to previous 1.90 (colored)

Constify both struct disk->dk_name and the `name' argument to
disk_init().

Revision 1.90 / (download) - annotate - [select for diffs], Wed Jan 2 11:48:52 2008 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.89: +4 -3 lines
Diff to previous 1.89 (colored)

Merge vmlocking2 to head.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Oct 8 16:41:15 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, vmlocking-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, jmcneill-base, cube-autoconf-base, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: vmlocking2, mjf-devfs, cube-autoconf, bouyer-xeni386
Changes since 1.88: +17 -54 lines
Diff to previous 1.88 (colored)

Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.

Revision 1.88 / (download) - annotate - [select for diffs], Sun Jul 29 12:15:45 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base2, yamt-x86pmap-base, nick-csl-alignment-base5, matt-mips64-base, hpcarm-cleanup
Branch point for: yamt-x86pmap, matt-mips64, matt-armv6, jmcneill-pm
Changes since 1.87: +9 -18 lines
Diff to previous 1.87 (colored)

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.

Revision 1.87 / (download) - annotate - [select for diffs], Sat Jul 21 19:51:49 2007 UTC (16 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.86: +6 -6 lines
Diff to previous 1.86 (colored)

Replace some uses of lockmgr().

Revision 1.86 / (download) - annotate - [select for diffs], Sun Jun 24 01:43:35 2007 UTC (16 years, 10 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: nick-csl-alignment
Changes since 1.85: +78 -2 lines
Diff to previous 1.85 (colored)

Extract common code from i386, xen, and sparc64, creating
config_handle_wedges() and read_disk_sectors().  On x86, handle_wedges()
is a thin wrapper for config_handle_wedges().  Share opendisk()
across architectures.

Add kernel code in support of specifying a root partition by wedge
name.  E.g., root specifications "wedge:wd0a", "wedge:David's Root
Volume" are possible.  (Patches for config(1) coming soon.)

In support of moving disks between architectures (esp. i386 <->
evbmips), I've written a routine convertdisklabel() that ensures
that the raw partition is at RAW_DISK by following these steps:

        0 If we have read a disklabel that has a RAW_PART with
          p_offset == 0 and p_size != 0, then use that raw partition.

        1 If we have read a disklabel that has both partitions 'c'
          and 'd', and RAW_PART has p_offset != 0 or p_size == 0,
          but the other partition is suitable for a raw partition
          (p_offset == 0, p_size != 0), then swap the two partitions
          and use the new raw partition.

        2 If the architecture's raw partition is 'd', and if there
          is no partition 'd', but there is a partition 'c' that
          is suitable for a raw partition, then copy partition 'c'
          to partition 'd'.

        3 Determine the drive's last sector, using either the
          d_secperunit the drive reported, or by guessing (0x1fffffff).
          If we cannot read the drive's last sector, then fail.

        4 If we have read a disklabel that has no partition slot
          RAW_PART, then create a partition RAW_PART.  Make it span
          the whole drive.

        5 If there are fewer than MAXPARTITIONS partitions,
          then "slide" the unsuitable raw partition RAW_PART, and
          subsequent partitions, into partition slots RAW_PART+1
          and subsequent slots.  Create a raw partition at RAW_PART.
          Make it span the whole drive.

The convertdisklabel() procedure can probably stand to be simplified,
but it ought to deal with all but an extraordinarily broken disklabel,
now.

i386: compiled and tested, sparc64: compiled, evbmips: compiled.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:07 2007 UTC (17 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.84 / (download) - annotate - [select for diffs], Thu Mar 1 21:30:50 2007 UTC (17 years, 1 month ago) by martin
Branch: MAIN
Changes since 1.83: +9 -3 lines
Diff to previous 1.83 (colored)

Split the disklabel checksum function into two, so we can pass the
length separately.
Use this for foreign-endianess labels in wedge autodiscovery, and
calculate the checksum of those before we swap various fields in the
label.

Revision 1.83 / (download) - annotate - [select for diffs], Sat Nov 25 11:59:58 2006 UTC (17 years, 4 months ago) by scw
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, post-newlock2-merge, newlock2-nbase, newlock2-base, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm, ad-audiomp-base, ad-audiomp
Branch point for: yamt-idlelwp, netbsd-4
Changes since 1.82: +79 -2 lines
Diff to previous 1.82 (colored)

Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().

Revision 1.82 / (download) - annotate - [select for diffs], Wed Oct 25 04:04:46 2006 UTC (17 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.81: +32 -2 lines
Diff to previous 1.81 (colored)

- Add a new disk ioctl (DIOCGDISKINFO) to get the disk-info dictionary
  for the disk.
- Add a new function, disk_ioctl(), that does generic disk ioctl handling.
  DIOCGDISKINFO is handled here now, and others will be added in the future.
- In the wd driver, fill in the dk_info member of struct disk and use the
  new disk_ioctl() function.

Revision 1.81 / (download) - annotate - [select for diffs], Fri Sep 22 04:48:38 2006 UTC (17 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.80: +10 -2 lines
Diff to previous 1.80 (colored)

- Define disk information, disk geometry, and disk partition dictionary
  schemas.  Disk information and disk geometry are designed to replace
  information currently conveyed to user space using struct disklabel.
- Add a dk_info member to struct disk; a reference to a disk information
  dictionary.  This dictionary is to be allocated and the reference stored
  in struct disk by individual drivers.
- disk_detach0() will release dk_info if non-NULL.
- Convert the wd(4) driver to stash geometry and other disk properties
  as the "disk-info" property in its properties dictionary.  This needs
  some cleanup, but will serve as an example of what to do with other
  disk drivers.

Revision 1.80 / (download) - annotate - [select for diffs], Wed Aug 23 17:19:32 2006 UTC (17 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.79: +3 -5 lines
Diff to previous 1.79 (colored)

Change iostat_alloc() to take the parent pointer and the name directly, so
that callers are not responsible for initializing the fields. Store the name
inside the struct instead of maintaining a pointer to external storage, or
leaked memory (nfs case).

Revision 1.79 / (download) - annotate - [select for diffs], Wed Jun 7 22:33:40 2006 UTC (17 years, 10 months ago) by kardel
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, yamt-pdpolicy-base6, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.78: +3 -2 lines
Diff to previous 1.78 (colored)

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html

Revision 1.78 / (download) - annotate - [select for diffs], Fri Apr 21 13:53:30 2006 UTC (18 years ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, simonb-timecounters-base, elad-kernelauth-base
Branch point for: chap-midi
Changes since 1.77: +1 -1 lines
Diff to previous 1.77 (colored)

iostat_find/disk_find: constify and simplify.

Revision 1.77 / (download) - annotate - [select for diffs], Fri Apr 21 13:51:24 2006 UTC (18 years ago) by yamt
Branch: MAIN
Changes since 1.76: +0 -2 lines
Diff to previous 1.76 (colored)

remove some unnecessary #include.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Apr 21 13:48:57 2006 UTC (18 years ago) by yamt
Branch: MAIN
Changes since 1.75: +8 -7 lines
Diff to previous 1.75 (colored)

whitespace.

Revision 1.75 / (download) - annotate - [select for diffs], Thu Apr 20 12:13:53 2006 UTC (18 years ago) by blymn
Branch: MAIN
Changes since 1.74: +6 -6 lines
Diff to previous 1.74 (colored)

Prefix iostat structure elements with io_

Revision 1.74 / (download) - annotate - [select for diffs], Fri Apr 14 13:09:06 2006 UTC (18 years ago) by blymn
Branch: MAIN
Changes since 1.73: +18 -230 lines
Diff to previous 1.73 (colored)

Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Dec 26 18:45:27 2005 UTC (18 years, 3 months ago) by perry
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, peter-altq, elad-kernelauth
Changes since 1.72: +3 -3 lines
Diff to previous 1.72 (colored)

u_intN_t -> uintN_t

Revision 1.72 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:30 2005 UTC (18 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

merge ktrace-lwp.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Oct 15 17:29:26 2005 UTC (18 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Changes since 1.70: +2 -94 lines
Diff to previous 1.70 (colored)

- change the way to specify a bufq strategy.  (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)

Revision 1.70 / (download) - annotate - [select for diffs], Sat Aug 20 12:00:01 2005 UTC (18 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.69: +72 -22 lines
Diff to previous 1.69 (colored)

introduce a variant of disk_attach/detach, for pseudo disks
which is opened by user before being attached.

Revision 1.69 / (download) - annotate - [select for diffs], Sun May 29 22:24:15 2005 UTC (18 years, 10 months ago) by christos
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.68: +11 -11 lines
Diff to previous 1.68 (colored)

- add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.

Revision 1.68 / (download) - annotate - [select for diffs], Thu Mar 31 11:28:53 2005 UTC (19 years ago) by yamt
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.67: +18 -2 lines
Diff to previous 1.67 (colored)

introduce a function to drain bufq and use it where appropriate.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Feb 8 08:56:21 2005 UTC (19 years, 2 months ago) by fvdl
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, yamt-km-base2, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored)

Change the 'sz' variable in bounds_check_* to int64_t to avoid overflows
when a very large blocknumber is passed in.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Feb 6 23:57:29 2005 UTC (19 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.65: +12 -13 lines
Diff to previous 1.65 (colored)

Change an if/panic statement to a KASSERT and disable a chatty printf.

Revision 1.65 / (download) - annotate - [select for diffs], Thu Nov 25 04:52:24 2004 UTC (19 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.64: +39 -26 lines
Diff to previous 1.64 (colored)

lookup bufq using link_set rather than a switch statement.

Revision 1.64 / (download) - annotate - [select for diffs], Thu Oct 28 07:07:46 2004 UTC (19 years, 5 months ago) by yamt
Branch: MAIN
Changes since 1.63: +3 -2 lines
Diff to previous 1.63 (colored)

move buffer queue related stuffs from buf.h to their own header, bufq.h.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Oct 15 07:19:01 2004 UTC (19 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.62: +7 -17 lines
Diff to previous 1.62 (colored)

- Eliminate the need to call disk_init().
- disk_count needs to be protected with disklist_slock, too.

Revision 1.62 / (download) - annotate - [select for diffs], Thu Oct 14 05:12:28 2004 UTC (19 years, 6 months ago) by yamt
Branch: MAIN
Changes since 1.61: +8 -574 lines
Diff to previous 1.61 (colored)

move i/o schedulers to their own files.
namely, from kern/subr_disk.c to kern/bufq_{fcfs,disksort,readprio,priocscan}.c.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Sep 25 03:30:44 2004 UTC (19 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.60: +12 -2 lines
Diff to previous 1.60 (colored)

Work-in-progress implementation of "wedges", a new way to represent
partitions in the NetBSD kernel.  See discussion on tech-kern for details.

Revision 1.60 / (download) - annotate - [select for diffs], Tue Mar 9 12:23:07 2004 UTC (20 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.59: +5 -3 lines
Diff to previous 1.59 (colored)

- add a function prototype.
- consitify.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Feb 28 06:28:48 2004 UTC (20 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.58: +9 -2 lines
Diff to previous 1.58 (colored)

change the way to handle NEW_BUFQ_STRATEGY option.
instead of putting #ifdefs into each drivers,
use a global variable to indicate default strategy.

XXX should have a way to specify other strategies.

Revision 1.58 / (download) - annotate - [select for diffs], Sat Jan 10 14:49:44 2004 UTC (20 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.57: +263 -2 lines
Diff to previous 1.57 (colored)

add a new bufq strategy, BUFQ_PRIOCSCAN (per-priority CSCAN).
discussed on tech-kern@

Revision 1.57 / (download) - annotate - [select for diffs], Sat Dec 6 17:23:22 2003 UTC (20 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.56: +9 -6 lines
Diff to previous 1.56 (colored)

rev.1.55 didn't handle BUFQ_SORT_CYLINDER case correctly.
pointed by Juergen Hannken-Illjes.  patch provided by him.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Dec 6 01:21:23 2003 UTC (20 years, 4 months ago) by he
Branch: MAIN
Changes since 1.55: +3 -4 lines
Diff to previous 1.55 (colored)

Make sure buf_inorder() returns a value under all conditions.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Dec 5 10:16:16 2003 UTC (20 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.54: +6 -11 lines
Diff to previous 1.54 (colored)

buf_inorder: deal with 64-bit daddr_t correctly.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Dec 4 19:38:23 2003 UTC (20 years, 4 months ago) by atatat
Branch: MAIN
Changes since 1.53: +20 -12 lines
Diff to previous 1.53 (colored)

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Aug 7 16:31:52 2003 UTC (20 years, 8 months ago) by agc
Branch: MAIN
Changes since 1.52: +3 -7 lines
Diff to previous 1.52 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Apr 13 09:08:04 2003 UTC (21 years ago) by dsl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored)

CONSTCONT should have been CONSTCOND

Revision 1.51 / (download) - annotate - [select for diffs], Sun Apr 13 07:51:30 2003 UTC (21 years ago) by dsl
Branch: MAIN
Changes since 1.50: +17 -10 lines
Diff to previous 1.50 (colored)

Fix error message for 64bit daddr_t

Revision 1.50 / (download) - annotate - [select for diffs], Thu Apr 3 22:20:24 2003 UTC (21 years ago) by fvdl
Branch: MAIN
Changes since 1.49: +38 -2 lines
Diff to previous 1.49 (colored)

Add a bounds_check_with_mediasize function, which is intended
for checking RAW_PART transfers (and later raw disk devices).

Revision 1.49 / (download) - annotate - [select for diffs], Wed Nov 6 02:31:34 2002 UTC (21 years, 5 months ago) by enami
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.48: +8 -17 lines
Diff to previous 1.48 (colored)

Factor out the COMPAT_16 code.

Revision 1.48 / (download) - annotate - [select for diffs], Tue Nov 5 13:22:32 2002 UTC (21 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.47: +19 -12 lines
Diff to previous 1.47 (colored)

- do the COMPAT_16 dance in sysctl_diskstats() for the where == NULL case
  as well.  pointed out by enami@.
- defflag COMPAT_16.

Revision 1.47 / (download) - annotate - [select for diffs], Mon Nov 4 03:50:07 2002 UTC (21 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.46: +16 -3 lines
Diff to previous 1.46 (colored)

repair backwards compatibility with netbsd 1.6 - if we are not given the
wanted sizeof(struct disk_sysctl), use the old size.  for non-COMPAT_16,
however, we return EINVAL so that all future programs are forced into
passing the wanted size.  1.6 iostat(8) works with -current kernel again.

as seen on tech-kern.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Nov 1 15:20:03 2002 UTC (21 years, 5 months ago) by simonb
Branch: MAIN
Changes since 1.45: +7 -4 lines
Diff to previous 1.45 (colored)

When calculating the space needed for the data, use the supplied
userland structure size (if passed in).
Use the supplied userland structure size (if passed in) to check if
there is enough room to copyout the next structure.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Nov 1 11:32:01 2002 UTC (21 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.44: +21 -11 lines
Diff to previous 1.44 (colored)

implement separate read/write disk statistics:
	- disk_unbusy() gets a new parameter to tell the IO direction.
	- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
	when processing hw.diskstats, add the read&write bytes/transfers for
	the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail.  however, the next time this is
change it will not fail again.

this is just the kernel portion.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Nov 1 03:34:07 2002 UTC (21 years, 5 months ago) by enami
Branch: MAIN
Changes since 1.43: +8 -7 lines
Diff to previous 1.43 (colored)

Make this works with QUEUEDEBUG defined; don't use queue pointer after
removing an element from queue.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Nov 1 03:32:21 2002 UTC (21 years, 5 months ago) by enami
Branch: MAIN
Changes since 1.42: +11 -11 lines
Diff to previous 1.42 (colored)

Cosmetic changes.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Aug 30 15:43:40 2002 UTC (21 years, 7 months ago) by hannken
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gehenna-devsw-base
Changes since 1.41: +2 -215 lines
Diff to previous 1.41 (colored)

Remove the old device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>

Revision 1.41 / (download) - annotate - [select for diffs], Tue Jul 23 14:00:16 2002 UTC (21 years, 9 months ago) by hannken
Branch: MAIN
Changes since 1.40: +35 -24 lines
Diff to previous 1.40 (colored)

The buffer returned by BUFQ_PEEK must remain the same until BUFQ_GET is
called. It may be used as the "current" buffer.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jul 21 15:32:19 2002 UTC (21 years, 9 months ago) by hannken
Branch: MAIN
Changes since 1.39: +28 -12 lines
Diff to previous 1.39 (colored)

Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jul 16 18:03:19 2002 UTC (21 years, 9 months ago) by hannken
Branch: MAIN
Changes since 1.38: +343 -2 lines
Diff to previous 1.38 (colored)

Implement a new device buffer queue interface.
One basic struct, a function to setup a queue with a specific strategy and
three macros to put buf's into the queue, get and remove the next buf or
get the next buf without removal.

The BUFQ_XXX interface will be removed in the future.
The B_ORDERED flag is not longer supported.

Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 28 16:37:21 2002 UTC (21 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.37: +4 -4 lines
Diff to previous 1.37 (colored)

constify diskerr().

Revision 1.37 / (download) - annotate - [select for diffs], Sat Feb 16 02:11:43 2002 UTC (22 years, 2 months ago) by enami
Branch: MAIN
CVS Tags: newlock-base, newlock, netbsd-1-6-base, ifpoll-base, eeh-devprop-base, eeh-devprop
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored)

Use sizeof correctly.  Fixes PR#15613.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Feb 16 02:07:56 2002 UTC (22 years, 2 months ago) by enami
Branch: MAIN
Changes since 1.35: +7 -5 lines
Diff to previous 1.35 (colored)

- Wrap long line.
- Remove unnecessary semi-colon.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jan 28 03:33:55 2002 UTC (22 years, 2 months ago) by simonb
Branch: MAIN
Changes since 1.34: +6 -3 lines
Diff to previous 1.34 (colored)

Remember to update the "size copied" counter in sysctl_diskstats().

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jan 28 03:12:13 2002 UTC (22 years, 2 months ago) by simonb
Branch: MAIN
Changes since 1.33: +3 -4 lines
Diff to previous 1.33 (colored)

Use TAILQ_FOREACH().

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jan 27 12:41:08 2002 UTC (22 years, 2 months ago) by simonb
Branch: MAIN
Changes since 1.32: +110 -7 lines
Diff to previous 1.32 (colored)

Implement the hw.disknames and hw.diskstats sysctl's that have been listed
in <sys/sysctl.h> since day one but never implemented.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Nov 30 01:31:30 2001 UTC (22 years, 4 months ago) by enami
Branch: MAIN
Changes since 1.31: +4 -4 lines
Diff to previous 1.31 (colored)

Use cached pointer to next buf instead of re-fetching it.  GCC actually
generates different code.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Nov 13 13:33:44 2001 UTC (22 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.30: +4 -1 lines
Diff to previous 1.30 (colored)

add RCSID

Revision 1.30 / (download) - annotate - [select for diffs], Mon Jul 9 10:54:12 2001 UTC (22 years, 9 months ago) by simonb
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp, kqueue
Changes since 1.29: +15 -32 lines
Diff to previous 1.29 (colored)

ANSIfy.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Mar 30 09:27:12 2000 UTC (24 years ago) by augustss
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: nathanw_sa
Changes since 1.28: +7 -7 lines
Diff to previous 1.28 (colored)

Get rid of register declarations.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Feb 7 20:16:58 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.27: +11 -10 lines
Diff to previous 1.27 (colored)

Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle.  Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Jan 28 09:27:38 2000 UTC (24 years, 2 months ago) by hannken
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

The decision that `disksort_cylinder' uses to decide if the buffer needs
to go to the inversion list is incomplete. If the cylinders are equal
block numbers must be checked.

This caused lockups if some buffers with the same cylinder were cycling
through the list, as it may happen with softdep enabled.

Fixes PR #9197.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jan 21 23:20:51 2000 UTC (24 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.25: +153 -36 lines
Diff to previous 1.25 (colored)

- Add a B_ORDERED flag to communicate to drivers that an I/O request should
  be issued/completed in order; that is, provide a barrier for I/O queues.
- Change the buffer driver queue links to a TAILQ, rather than using
  a home-grown equivalent.  Provide BUFQ_*() macros to manipulate buffer
  queues; these deal with the barrier provided by B_ORDERED.
- Update disksort() accordingly, and provide 3 versions:
	- disksort_cylinder(): historical disksort(), which keys on
	  b_cylinder (and b_blkno for the case when b_cylinder matches).
	- disksort_blkno(): sorts only on b_blkno.  Essentially the
	  same as disksort_cylinder(), but with fewer comparisons.
	- disksort_tail(): requests are simply inserted into the queue
	  at the tail.  This is provided as an option so that drivers
	  can simply have a pointer to the appropriate sort function.
  Note that disksort() now pays attention to B_ORDERED.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Feb 22 16:00:01 1999 UTC (25 years, 2 months ago) by drochner
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-base, chs-ubc2
Branch point for: wrstuden-devbsize, thorpej_scsipi
Changes since 1.24: +2 -7 lines
Diff to previous 1.24 (colored)

PR kern/7033 (Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>): use
device minor to unit/partition macros from sys/disklabel.h

Revision 1.24 / (download) - annotate - [select for diffs], Tue Aug 4 04:03:14 1998 UTC (25 years, 8 months ago) by perry
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach, chs-ubc-base, chs-ubc
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
  bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 30 09:51:24 1997 UTC (26 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: eeh-paddr_t-base, eeh-paddr_t
Changes since 1.22: +12 -10 lines
Diff to previous 1.22 (colored)

Rearrange disk_detach() slightly, and make a small run-time cosmetic
change in disk_unbusy().

Revision 1.22 / (download) - annotate - [select for diffs], Sun Oct 5 18:39:51 1997 UTC (26 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, marc-pcmcia-base
Changes since 1.21: +38 -2 lines
Diff to previous 1.21 (colored)

Copyright assigned to The NetBSD Foundation.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Oct 17 16:31:56 1996 UTC (27 years, 6 months ago) by perry
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, thorpej-setroot, mrg-vm-swap, marc-pcmcia-bp, is-newarp-before-merge, is-newarp-base, is-newarp, bouyer-scsipi
Branch point for: marc-pcmcia
Changes since 1.20: +1 -4 lines
Diff to previous 1.20 (colored)

removed #ifdef tahoe

Revision 1.20 / (download) - annotate - [select for diffs], Sun Oct 13 02:32:37 1996 UTC (27 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

backout previous kprintf change

Revision 1.19 / (download) - annotate - [select for diffs], Thu Oct 10 22:46:24 1996 UTC (27 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

printf -> kprintf, sprintf -> ksprintf

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jul 12 22:00:44 1996 UTC (27 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.17: +1 -16 lines
Diff to previous 1.17 (colored)

Remove old-style disk instrumentation code.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Mar 16 23:17:08 1996 UTC (28 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored)

Fix printf() formats.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Feb 9 18:59:56 1996 UTC (28 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored)

More proto fixes

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jan 7 22:03:49 1996 UTC (28 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.14: +181 -3 lines
Diff to previous 1.14 (colored)

New generic disk framework.  Highlights:

	- New metrics handling.  Metrics are now kept in the new
	  `struct disk'.  Busy time is now stored as a timeval, and
	  transfer count in bytes.

	- Storage for disklabels is now dynamically allocated, so that
	  the size of the disk structure is not machine-dependent.

	- Several new functions for attaching and detaching disks, and
	  handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Dec 28 19:16:39 1995 UTC (28 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.13: +15 -1 lines
Diff to previous 1.13 (colored)

Move the old-style disk instrumentation "structures" to a central location
(sys/kern/subr_disk.c) and note that they should/will be deperecated.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Mar 29 20:57:35 1995 UTC (29 years ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.12: +1 -8 lines
Diff to previous 1.12 (colored)

Make definition of b_cylinder global.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jun 29 06:32:56 1994 UTC (29 years, 9 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.11 / (download) - annotate - [select for diffs], Thu May 19 03:43:13 1994 UTC (29 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.10: +225 -1 lines
Diff to previous 1.10 (colored)

Update to 4.4-Lite.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Feb 10 15:43:20 1994 UTC (30 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.9: +1 -1 lines
Diff to previous 1.9 (colored)

Don't need back pointers for disksort().

Revision 1.9 / (download) - annotate - [select for diffs], Sun Feb 6 17:39:48 1994 UTC (30 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.8: +1 -1 lines
Diff to previous 1.8 (colored)

Remove another use of b_actl.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Feb 6 10:00:30 1994 UTC (30 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.7: +1 -1 lines
Diff to previous 1.7 (colored)

Use b_actf, not av_forw.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jan 23 19:11:25 1994 UTC (30 years, 3 months ago) by glass
Branch: MAIN
Changes since 1.6: +1 -1 lines
Diff to previous 1.6 (colored)

remove warning

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jan 11 16:38:09 1994 UTC (30 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.5: +1 -1 lines
Diff to previous 1.5 (colored)

Get rid of disklabel indirection functions.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Dec 17 08:12:07 1993 UTC (30 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.4: +1 -1 lines
Diff to previous 1.4 (colored)

Canonicalize all #includes.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Sep 5 22:07:31 1993 UTC (30 years, 7 months ago) by mycroft
Branch: MAIN
CVS Tags: magnum-base
Branch point for: magnum
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (colored)

Add \n to end of error message.

Revision 1.3 / (download) - annotate - [select for diffs], Thu May 20 23:16:51 1993 UTC (30 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: netbsd-0-9-patch-001, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored)

more disklabel changes

Revision 1.2 / (download) - annotate - [select for diffs], Thu May 20 03:53:35 1993 UTC (30 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

add rcs ids, and clean up headers where necessary

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years, 1 month ago) by cgd
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>