Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/dev/md/md.c

[BACK] Up to [FreeBSD] / src / sys / dev / md

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.203: download - view: text, markup, annotated - select for diffs
Tue Dec 13 00:38:50 2011 UTC (8 weeks, 2 days ago) by eadler
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +4 -2 lines
SVN rev 228449 on 2011-12-13 00:38:50Z by eadler

Document a large number of currently undocumented sysctls. While here
fix some style(9) issues and reduce redundancy.

PR:		kern/155491
PR:		kern/155490
PR:		kern/155489
Submitted by:	Galimov Albert <wtfcrap@mail.ru>
Approved by:	bde
Reviewed by:	jhb
MFC after:	1 week

Revision 1.201.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.201.2.1: preferred, colored; next MAIN 1.202: preferred, colored
Changes since revision 1.201.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.202: download - view: text, markup, annotated - select for diffs
Mon Oct 31 10:53:27 2011 UTC (3 months, 1 week ago) by ae
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +5 -0 lines
SVN rev 226966 on 2011-10-31 10:53:27Z by ae

Add information about MD_READONLY and MD_COMPRESS flags to the
configuration dump.

MFC after:	1 week

Revision 1.201.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.201: preferred, colored; next MAIN 1.202: preferred, colored
Changes since revision 1.201: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.201: download - view: text, markup, annotated - select for diffs
Mon Jul 11 05:19:28 2011 UTC (7 months ago) by ae
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +1 -0 lines
SVN rev 223920 on 2011-07-11 05:19:28Z by ae

Include sys/sbuf.h directly.

Revision 1.200: download - view: text, markup, annotated - select for diffs
Fri May 13 19:35:01 2011 UTC (8 months, 4 weeks ago) by mdf
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +2 -0 lines
SVN rev 221855 on 2011-05-13 19:35:01Z by mdf

Move the ZERO_REGION_SIZE to a machine-dependent file, as on many
architectures (i386, for example) the virtual memory space may be
constrained enough that 2MB is a large chunk.  Use 64K for arches
other than amd64 and ia64, with special handling for sparc64 due to
differing hardware.

Also commit the comment changes to kmem_init_zero_region() that I
missed due to not saving the file.  (Darn the unfamiliar development
environment).

Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you
see fit.

Requested by:	alc
MFC after:	1 week
MFC with:	r221853

Revision 1.199: download - view: text, markup, annotated - select for diffs
Fri May 13 18:48:00 2011 UTC (8 months, 4 weeks ago) by mdf
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +3 -5 lines
SVN rev 221853 on 2011-05-13 18:48:00Z by mdf

Usa a globally visible region of zeros for both /dev/zero and the md
device.  There are likely other kernel uses of "blob of zeros" than can
be converted.

Reviewed by:	alc
MFC after:	1 week

Revision 1.198: download - view: text, markup, annotated - select for diffs
Fri Apr 29 21:18:41 2011 UTC (9 months, 1 week ago) by des
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +42 -0 lines
SVN rev 221229 on 2011-04-29 21:18:41Z by des

Implement BIO_DELETE for vnode devices by simply overwriting the deleted
sectors with all-zeroes.

The zeroes come from a static buffer; null(4) uses a dynamic buffer for
the same purpose (for /dev/zero).  It might be a good idea to have a
static, shared, read-only all-zeroes page somewhere in the kernel that
md(4), null(4) and any other code that needs zeroes could use.

Reviewed by:	kib
MFC after:	3 weeks

Revision 1.182.2.11: download - view: text, markup, annotated - select for diffs
Fri Mar 18 08:52:26 2011 UTC (10 months, 3 weeks ago) by jh
Branches: RELENG_8
Diff to: previous 1.182.2.10: preferred, colored; branchpoint 1.182: preferred, colored; next MAIN 1.183: preferred, colored
Changes since revision 1.182.2.10: +7 -9 lines
SVN rev 219729 on 2011-03-18 08:52:26Z by jh

MFC r210496:

- Remove some extra white space.
- Wrap g_md_dumpconf() prototype to 80 columns.

Revision 1.182.2.10: download - view: text, markup, annotated - select for diffs
Fri Mar 18 08:48:06 2011 UTC (10 months, 3 weeks ago) by jh
Branches: RELENG_8
Diff to: previous 1.182.2.9: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.9: +20 -12 lines
SVN rev 219728 on 2011-03-18 08:48:06Z by jh

MFC r210371:

Convert md(4) to use alloc_unr(9) and alloc_unr_specific(9) for unit
number allocation. The old approach had some problems such as it allowed
an overflow to occur in the unit number calculation.

PR:		kern/122288

Revision 1.197: download - view: text, markup, annotated - select for diffs
Wed Feb 9 19:31:10 2011 UTC (11 months, 4 weeks ago) by marcel
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +9 -10 lines
SVN rev 218495 on 2011-02-09 19:31:10Z by marcel

Use the preload_fetch_addr() and preload_fetch_size() convenience
functions and only create the MD device when we have a non-zero
pointer and size.

Sponsored by: Juniper Networks

Revision 1.182.2.9: download - view: text, markup, annotated - select for diffs
Tue Feb 8 09:28:28 2011 UTC (12 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.182.2.8: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.8: +10 -6 lines
SVN rev 218431 on 2011-02-08 09:28:28Z by kib

MFC r217946:
Add support for BIO_DELETE on swap-backed md(4).

Revision 1.182.2.8: download - view: text, markup, annotated - select for diffs
Tue Feb 1 10:18:36 2011 UTC (12 months, 1 week ago) by kib
Branches: RELENG_8
Diff to: previous 1.182.2.7: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.7: +1 -1 lines
SVN rev 218163 on 2011-02-01 10:18:36Z by kib

MFC r217823:
Bio shall not be accessed after g_io_deliver(9).

Revision 1.196: download - view: text, markup, annotated - select for diffs
Thu Jan 27 16:10:25 2011 UTC (12 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +10 -6 lines
SVN rev 217946 on 2011-01-27 16:10:25Z by kib

Add support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE
covering the whole page, free the page. Otherwise, clear the region and
mark it clean. Not marking the page dirty could reinstantiate cleared
data, but it is allowed by BIO_DELETE specification and saves unneeded
write to swap.

Reviewed by:	alc
Tested by:	pho
MFC after:	2 weeks

Revision 1.195: download - view: text, markup, annotated - select for diffs
Tue Jan 25 14:00:30 2011 UTC (12 months, 2 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +1 -1 lines
SVN rev 217823 on 2011-01-25 14:00:30Z by kib

Bio shall not be accessed after g_io_deliver(9).

Reported and tested by:	pho
Reviewed by:	ae, phk
MFC after:	1 week

Revision 1.182.2.7: download - view: text, markup, annotated - select for diffs
Sat Jan 22 11:29:13 2011 UTC (12 months, 2 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.182.2.6: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.6: +2 -2 lines
SVN rev 217716 on 2011-01-22 11:29:13Z by kib

MFC r217583:
Add missed ().

Revision 1.194: download - view: text, markup, annotated - select for diffs
Wed Jan 19 16:48:07 2011 UTC (12 months, 2 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +2 -2 lines
SVN rev 217583 on 2011-01-19 16:48:07Z by kib

Add missed ().

Noted by:	alc
MFC after:	3 days

Revision 1.193: download - view: text, markup, annotated - select for diffs
Wed Jan 19 15:43:54 2011 UTC (12 months, 3 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +0 -1 lines
SVN rev 217581 on 2011-01-19 15:43:54Z by alc

There is no point in calling vm_object_set_writeable_dirty() on an object
that is definitively known to be swap backed since its only effects are on
vnode-backed objects.

Reviewed by:	kib

Revision 1.182.2.6: download - view: text, markup, annotated - select for diffs
Wed Jan 5 12:47:42 2011 UTC (13 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.182.2.5: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.5: +3 -2 lines
SVN rev 217003 on 2011-01-05 12:47:42Z by kib

MFC r216794:
Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4).
Non-zero value of attribute means that device supports BIO_DELETE.

Revision 1.182.2.5: download - view: text, markup, annotated - select for diffs
Wed Jan 5 12:45:11 2011 UTC (13 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.182.2.4: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.4: +8 -3 lines
SVN rev 217002 on 2011-01-05 12:45:11Z by kib

MFC r216793:
Add sysctl vm.md_malloc_wait, non-zero value of which switches malloc-backed
md(4) to using M_WAITOK malloc calls.

Revision 1.192: download - view: text, markup, annotated - select for diffs
Wed Dec 29 12:11:07 2010 UTC (13 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +3 -2 lines
SVN rev 216794 on 2010-12-29 12:11:07Z by kib

Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4).
Non-zero value of attribute means that device supports BIO_DELETE.

Suggested and reviewed by:	pjd
Tested by:	pho
MFC after:	1 week

Revision 1.191: download - view: text, markup, annotated - select for diffs
Wed Dec 29 11:39:15 2010 UTC (13 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +8 -3 lines
SVN rev 216793 on 2010-12-29 11:39:15Z by kib

Add sysctl vm.md_malloc_wait, non-zero value of which switches malloc-backed
md(4) to using M_WAITOK malloc calls.

M_NOWAITOK allocations may fail when enough memory could be freed, but not
immediately. E.g. SU UFS becomes quite unhappy when metadata write return
error, that would happen for failed malloc() call.

Reported and tested by:	pho
MFC after:	1 week

Revision 1.169.2.3.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.169.2.3: preferred, colored; next MAIN 1.170: preferred, colored
Changes since revision 1.169.2.3: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.182.2.4.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.182.2.4: preferred, colored; next MAIN 1.182.2.5: preferred, colored
Changes since revision 1.182.2.4: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.190: download - view: text, markup, annotated - select for diffs
Mon Oct 18 04:26:32 2010 UTC (15 months, 3 weeks ago) by marcel
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +16 -8 lines
SVN rev 214003 on 2010-10-18 04:26:32Z by marcel

Allow the MDIOCATTACH ioctl operation to originate from within the kernel.
To protect against malicious software, we demand that the file name is at
a particular location (i.e. appended to the mdio structure) for it to be
treated as in-kernel.

Revision 1.189: download - view: text, markup, annotated - select for diffs
Mon Jul 26 10:37:14 2010 UTC (18 months, 2 weeks ago) by jh
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +7 -9 lines
SVN rev 210496 on 2010-07-26 10:37:14Z by jh

- Remove some extra white space.
- Wrap g_md_dumpconf() prototype to 80 columns.

Revision 1.188: download - view: text, markup, annotated - select for diffs
Thu Jul 22 10:24:28 2010 UTC (18 months, 2 weeks ago) by jh
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +20 -12 lines
SVN rev 210371 on 2010-07-22 10:24:28Z by jh

Convert md(4) to use alloc_unr(9) and alloc_unr_specific(9) for unit
number allocation. The old approach had some problems such as it allowed
an overflow to occur in the unit number calculation.

PR:		kern/122288

Revision 1.169.2.3: download - view: text, markup, annotated - select for diffs
Tue Jul 13 08:55:52 2010 UTC (18 months, 4 weeks ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.169.2.2: preferred, colored; branchpoint 1.169: preferred, colored; next MAIN 1.170: preferred, colored
Changes since revision 1.169.2.2: +6 -4 lines
SVN rev 209986 on 2010-07-13 08:55:52Z by kib

MFC r209743:
Calculate nshift only once.

Revision 1.182.2.4: download - view: text, markup, annotated - select for diffs
Tue Jul 13 08:45:50 2010 UTC (18 months, 4 weeks ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.182.2.3: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.3: +6 -4 lines
SVN rev 209984 on 2010-07-13 08:45:50Z by kib

MFC r209743:
Calculate nshift only once.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Tue Jul 6 18:22:57 2010 UTC (19 months ago) by kib
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +6 -4 lines
SVN rev 209743 on 2010-07-06 18:22:57Z by kib

Calculate nshift only once.

Also noted by:	avg
MFC after:	1 week

Revision 1.186: download - view: text, markup, annotated - select for diffs
Tue Jun 15 18:37:31 2010 UTC (19 months, 3 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +1 -3 lines
SVN rev 209211 on 2010-06-15 18:37:31Z by alc

Eliminate unnecessary page queues locking.

Revision 1.182.2.3.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 3 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.182.2.3: preferred, colored; next MAIN 1.182.2.4: preferred, colored
Changes since revision 1.182.2.3: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.185: download - view: text, markup, annotated - select for diffs
Mon May 3 20:31:13 2010 UTC (21 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +2 -0 lines
SVN rev 207584 on 2010-05-03 20:31:13Z by kib

Lock the page around vm_page_activate() and vm_page_deactivate() calls
where it was missed. The wrapped fragments now protect wire_count with
page lock.

Reviewed by:	alc

Revision 1.182.2.3: download - view: text, markup, annotated - select for diffs
Sat Mar 27 14:43:40 2010 UTC (22 months, 2 weeks ago) by trasz
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.182.2.2: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.2: +2 -0 lines
SVN rev 205730 on 2010-03-27 14:43:40Z by trasz

MFC r204408:

Fix panic on invalid 'mdconfig -at preload' usage.

PR:		kern/80136

Revision 1.184: download - view: text, markup, annotated - select for diffs
Sat Feb 27 10:41:30 2010 UTC (23 months, 1 week ago) by trasz
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +2 -0 lines
SVN rev 204408 on 2010-02-27 10:41:30Z by trasz

Fix panic on invalid 'mdconfig -at preload' usage.

PR:		kern/80136

Revision 1.169.2.2.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (23 months, 4 weeks ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.169.2.2: preferred, colored; next MAIN 1.169.2.3: preferred, colored
Changes since revision 1.169.2.2: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.182.2.2: download - view: text, markup, annotated - select for diffs
Sat Jan 30 12:11:21 2010 UTC (2 years ago) by antoine
Branches: RELENG_8
Diff to: previous 1.182.2.1: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.2.1: +1 -1 lines
SVN rev 203184 on 2010-01-30 12:11:21Z by antoine

MFC r201145 to stable/8:
  (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
  Fix some wrong usages.
  Note: this does not affect generated binaries as this argument is not used.

  PR:		137213
  Submitted by:	Eygene Ryabinkin (initial version)

Revision 1.169.2.2: download - view: text, markup, annotated - select for diffs
Thu Jan 21 14:33:18 2010 UTC (2 years ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_3_BP
Branch point for: RELENG_7_3
Diff to: previous 1.169.2.1: preferred, colored; branchpoint 1.169: preferred, colored
Changes since revision 1.169.2.1: +20 -10 lines
SVN rev 202750 on 2010-01-21 14:33:18Z by jhb

MFC 189696,189697:
Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that a
filesystem supports additional operations using shared vnode locks.
Currently this is used to enable shared locks for open() and close() of
read-only file descriptors.
- When an ISOPEN namei() request is performed with LOCKSHARED, use a
  shared vnode lock for the leaf vnode only if the mount point has the
  extended shared flag set.
- Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but
  not O_CREAT.
- Use a shared vnode lock around VOP_CLOSE() if the file was opened with
  O_RDONLY and the mountpoint has the extended shared flag set.
- Adjust md(4) to upgrade the vnode lock on the vnode it gets back from
  vn_open() since it now may only have a shared vnode lock.
- Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since
  FIFO's require exclusive vnode locks for their open() and close()
  routines.  (My recent MPSAFE patches for UDF and cd9660 already included
  this change.)
- Enable extended shared operations on UFS, cd9660, and UDF.

Revision 1.183: download - view: text, markup, annotated - select for diffs
Mon Dec 28 22:56:30 2009 UTC (2 years, 1 month ago) by antoine
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +1 -1 lines
SVN rev 201145 on 2009-12-28 22:56:30Z by antoine

(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
Fix some wrong usages.
Note: this does not affect generated binaries as this argument is not used.

PR:		137213
Submitted by:	Eygene Ryabinkin (initial version)
MFC after:	1 month

Revision 1.182.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.182.2.1: preferred, colored; next MAIN 1.182.2.2: preferred, colored
Changes since revision 1.182.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.182.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.182: download - view: text, markup, annotated - select for diffs
Tue Jun 23 20:45:22 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +4 -4 lines
SVN rev 194766 on 2009-06-23 20:45:22Z by kib

Implement global and per-uid accounting of the anonymous memory. Add
rlimit RLIMIT_SWAP that limits the amount of swap that may be reserved
for the uid.

The accounting information (charge) is associated with either map entry,
or vm object backing the entry, assuming the object is the first one
in the shadow chain and entry does not require COW. Charge is moved
from entry to object on allocation of the object, e.g. during the mmap,
assuming the object is allocated, or on the first page fault on the
entry. It moves back to the entry on forks due to COW setup.

The per-entry granularity of accounting makes the charge process fair
for processes that change uid during lifetime, and decrements charge
for proper uid when region is unmapped.

The interface of vm_pager_allocate(9) is extended by adding struct ucred *,
that is used to charge appropriate uid when allocation if performed by
kernel, e.g. md(4).

Several syscalls, among them is fork(2), may now return ENOMEM when
global or per-uid limits are enforced.

In collaboration with:	pho
Reviewed by:	alc
Approved by:	re (kensmith)

Revision 1.181: download - view: text, markup, annotated - select for diffs
Mon May 18 18:37:18 2009 UTC (2 years, 8 months ago) by marcel
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +6 -3 lines
SVN rev 192323 on 2009-05-18 18:37:18Z by marcel

Add cpu_flush_dcache() for use after non-DMA based I/O so that a
possible future I-cache coherency operation can succeed. On ARM
for example the L1 cache can be (is) virtually mapped, which
means that any I/O that uses temporary mappings will not see the
I-cache made coherent. On ia64 a similar behaviour has been
observed. By flushing the D-cache, execution of binaries backed
by md(4) and/or NFS work reliably.
For Book-E (powerpc), execution over NFS exhibits SIGILL once in
a while as well, though cpu_flush_dcache() hasn't been implemented
yet.

Doing an explicit D-cache flush as part of the non-DMA based I/O
read operation eliminates the need to do it as part of the
I-cache coherency operation itself and as such avoids pessimizing
the DMA-based I/O read operations for which D-cache are already
flushed/invalidated. It also allows future optimizations whereby
the bcopy() followed by the D-cache flush can be integrated in a
single operation, which could be implemented using on-chips DMA
engines, by-passing the D-cache altogether.

Revision 1.169.2.1.4.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.169.2.1: preferred, colored; next MAIN 1.169.2.2: preferred, colored
Changes since revision 1.169.2.1: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.180: download - view: text, markup, annotated - select for diffs
Wed Mar 11 14:13:47 2009 UTC (2 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +20 -10 lines
SVN rev 189696 on 2009-03-11 14:13:47Z by jhb

Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that a
filesystem supports additional operations using shared vnode locks.
Currently this is used to enable shared locks for open() and close() of
read-only file descriptors.
- When an ISOPEN namei() request is performed with LOCKSHARED, use a
  shared vnode lock for the leaf vnode only if the mount point has the
  extended shared flag set.
- Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but
  not O_CREAT.
- Use a shared vnode lock around VOP_CLOSE() if the file was opened with
  O_RDONLY and the mountpoint has the extended shared flag set.
- Adjust md(4) to upgrade the vnode lock on the vnode it gets back from
  vn_open() since it now may only have a shared vnode lock.
- Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since
  FIFO's require exclusive vnode locks for their open() and close()
  routines.  (My recent MPSAFE patches for UDF and cd9660 already included
  this change.)
- Enable extended shared operations on UFS, cd9660, and UDF.

Submitted by:	ups
Reviewed by:	pjd (ZFS bits)
MFC after:	1 month

Revision 1.179: download - view: text, markup, annotated - select for diffs
Sun Feb 22 02:50:31 2009 UTC (2 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +1 -7 lines
SVN rev 188908 on 2009-02-22 02:50:31Z by alc

Remove unnecessary page queues locking around vm_page_wakeup().  (This
change is applicable to RELENG_7 but not RELENG_6.)

MFC after:	1 week

Revision 1.178: download - view: text, markup, annotated - select for diffs
Sat Jan 10 17:17:18 2009 UTC (3 years ago) by trasz
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +4 -2 lines
SVN rev 187027 on 2009-01-10 17:17:18Z by trasz

Add the possibility to specify "-o force" with "mdconfig -du".

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation

Revision 1.177: download - view: text, markup, annotated - select for diffs
Tue Dec 16 20:59:27 2008 UTC (3 years, 1 month ago) by trasz
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +4 -1 lines
SVN rev 186193 on 2008-12-16 20:59:27Z by trasz

Fix forced mdconfig -du.  E.g. the following would previously
result in panic:

mdconfig -af blah.img -o force
mount /dev/md0 /mnt
mdconfig -du 0

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation

Revision 1.169.2.1.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.169.2.1: preferred, colored; next MAIN 1.169.2.2: preferred, colored
Changes since revision 1.169.2.1: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.153.2.8.4.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.153.2.8: preferred, colored; next MAIN 1.154: preferred, colored
Changes since revision 1.153.2.8: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.176: download - view: text, markup, annotated - select for diffs
Thu Aug 28 15:23:18 2008 UTC (3 years, 5 months ago) by attilio
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +1 -1 lines
SVN rev 182371 on 2008-08-28 15:23:18Z by attilio

Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed thread
was always curthread and totally unuseful.

Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>

Revision 1.175: download - view: text, markup, annotated - select for diffs
Thu May 29 12:50:45 2008 UTC (3 years, 8 months ago) by ed
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +2 -1 lines
Remove the distinction between device minor and unit numbers.

Even though we got rid of device major numbers some time ago, device
drivers still need to provide unique device minor numbers to make_dev().
These numbers are only used inside the kernel. They are not related to
device major and minor numbers which are visible in devfs. These are
actually based on the inode number of the device.

It would eventually be nice to remove minor numbers entirely, but we
don't want to be too agressive here.

Because the 8-15 bits of the device number field (si_drv0) are still
reserved for the major number, there is no 1:1 mapping of the device
minor and unit numbers. Because this is now unused, remove the
restrictions on these numbers.

The MAXMAJOR definition was actually used for two purposes. It was used
to convert both the userspace and kernelspace device numbers to their
major/minor pair, which is why it is now named UMINORMASK.

minor2unit() and unit2minor() have now become useless. Both minor() and
dev2unit() now serve the same purpose. We should eventually remove some
of them, at least turning them into macro's. If devfs would become
completely minor number unaware, we could consider using si_drv0 directly,
just like si_drv1 and si_drv2.

Approved by:	philip (mentor)

Revision 1.169.2.1: download - view: text, markup, annotated - select for diffs
Sun Mar 2 11:33:54 2008 UTC (3 years, 11 months ago) by philip
Branches: RELENG_7
CVS tags: RELENG_7_2_BP, RELENG_7_1_BP
Branch point for: RELENG_7_2, RELENG_7_1
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +1 -0 lines
MFC r1.174:

    Zero sc->vnode if mdsetcred() fails.

    This fixes the panic which happens when mdcreate_vnode() calls vn_close()
    and mddestroy() calls it again further down the error handling path.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Thu Feb 28 18:31:54 2008 UTC (3 years, 11 months ago) by philip
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +1 -0 lines
Zero sc->vnode if mdsetcred() fails.

This fixes the panic which happens when mdcreate_vnode() calls vn_close()
and mddestroy() calls it again further down the error handling path.

Reviewed by:	kris, kib
MFC after:	3 days

Revision 1.173: download - view: text, markup, annotated - select for diffs
Sun Jan 13 14:44:02 2008 UTC (4 years ago) by attilio
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +8 -8 lines
VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in
conjuction with 'thread' argument passing which is always curthread.
Remove the unuseful extra-argument and pass explicitly curthread to lower
layer functions, when necessary.

KPI results broken by this change, which should affect several ports, so
version bumping and manpage update will be further committed.

Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>

Revision 1.172: download - view: text, markup, annotated - select for diffs
Thu Jan 10 01:10:44 2008 UTC (4 years, 1 month ago) by attilio
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +6 -6 lines
vn_lock() is currently only used with the 'curthread' passed as argument.
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.

Manpage and FreeBSD_version will be updated through further commits.

As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.

Tested by:	Diego Sardina <siarodx at gmail dot com>,
		Andrea Di Pasquale <whyx dot it at gmail dot com>

Revision 1.171: download - view: text, markup, annotated - select for diffs
Wed Nov 7 22:47:41 2007 UTC (4 years, 3 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +12 -0 lines
Put back devstat support that was lost during GEOM transition. Initially,
I've tried to move md(4) to use geom_disk class, like real disks do, but
this requires major rework of some of the existing features such as
configuration dumping for example. Therefore just putting devstat support
directly into md(4) seems to be optimal solution.

Now you can see md(4) stats in `systat -vm' again.

MFC after:	2 weeks

Revision 1.170: download - view: text, markup, annotated - select for diffs
Sat Oct 20 23:23:16 2007 UTC (4 years, 3 months ago) by julian
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +2 -2 lines
Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0  so that we can eventually MFC the
new kthread_xxx() calls.

Revision 1.169: download - view: text, markup, annotated - select for diffs
Tue Jun 5 00:00:51 2007 UTC (4 years, 8 months ago) by jeff
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +2 -2 lines
Commit 14/14 of sched_lock decomposition.
 - Use thread_lock() rather than sched_lock for per-thread scheduling
   sychronization.
 - Use the per-process spinlock rather than the sched_lock for per-process
   scheduling synchronization.

Tested by:      kris, current@
Tested on:      i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc.
Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)

Revision 1.168: download - view: text, markup, annotated - select for diffs
Thu May 31 11:51:49 2007 UTC (4 years, 8 months ago) by kib
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +1 -1 lines
Revert UF_OPENING workaround for CURRENT.
Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation
argument from being file descriptor index into the pointer to struct file.

Proposed and reviewed by:	jhb
Reviewed by:	daichi (unionfs)
Approved by:	re (kensmith)

Revision 1.153.2.8: download - view: text, markup, annotated - select for diffs
Fri Jan 5 09:51:14 2007 UTC (5 years, 1 month ago) by kib
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Branch point for: RELENG_6_4
Diff to: previous 1.153.2.7: preferred, colored; branchpoint 1.153: preferred, colored; next MAIN 1.154: preferred, colored
Changes since revision 1.153.2.7: +9 -0 lines
MFC
rev. 1.167 of src/sys/dev/md/md.c
rev. 1.514, 1.515 of src/sys/kern/vfs_bio.c
rev. 1.319, 1.320 of src/sys/sys/vnode.h

Resolve two deadlocks that could be caused by busy md device backed by
vnode.

Revision 1.153.2.7: download - view: text, markup, annotated - select for diffs
Thu Jan 4 17:39:17 2007 UTC (5 years, 1 month ago) by kib
Branches: RELENG_6
Diff to: previous 1.153.2.6: preferred, colored; branchpoint 1.153: preferred, colored
Changes since revision 1.153.2.6: +22 -28 lines
MFC of rev. 1.164:

- Conditionally acquire Giant in mdstart_vnode(), mdcreate_vnode(), and
  mddestroy() only if the file is from a non-MPSAFE fs.
There, to accommodate for the vn_open() difference with HEAD, use
VFS_LOCK_GIANT after vn_open (since vn_open(..., -1) assumes caller is not
MP-safe).
- No longer unconditionally hold Giant in the md kthread for vnode-backed
  kthreads.
- Improve the handling of the thread exit race when destroying an md
  device.

No objections from:	jhb

Revision 1.167: download - view: text, markup, annotated - select for diffs
Thu Dec 14 11:34:07 2006 UTC (5 years, 1 month ago) by kib
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +9 -0 lines
Resolve two deadlocks that could be caused by busy md device backed
by vnode. Allow for md thread and the thread that owns lock on vnode
backing the md device to do the write even when runningbufspace is
exhausted.

Tested by:	Peter Holm
Reviewed by:	tegge
MFC after:	2 weeks

Revision 1.166: download - view: text, markup, annotated - select for diffs
Wed Nov 1 18:59:06 2006 UTC (5 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +2 -2 lines
Style nits.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Wed Nov 1 18:56:18 2006 UTC (5 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +53 -10 lines
Fix md(4) panic which occurs when I/O request different than
BIO_READ/BIO_WRITE is sent to vnode-backed provider (BIO_DELETE or
BIO_FLUSH).

Reported by:	ceri

Add support for BIO_FLUSH to vnode-backed md(4) devices based on
VOP_FSYNC().

Revision 1.164: download - view: text, markup, annotated - select for diffs
Tue Mar 28 21:25:11 2006 UTC (5 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +23 -29 lines
- Conditionally acquire Giant in mdstart_vnode(), mdcreate_vnode(), and
  mddestroy() only if the file is from a non-MPSAFE VFS.
- No longer unconditionally hold Giant in the md kthread for vnode-backed
  kthreads.
- Improve the handling of the thread exit race when destroying an md
  device.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Sun Mar 26 23:21:11 2006 UTC (5 years, 10 months ago) by wkoszek
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +62 -0 lines
Teach md(4) and mdconfig(8) how to understand XML. Right now there won't be
a problem with listing large number of md(4) devices. Either 'list' or
'query' mode uses XML.

Additionally, new functionality was introduced. It's possible to pass
multiple devices to -u:

	# ./mdconfig -l -u md0,md1

Approved by:	cognet (mentor)

Revision 1.153.2.6: download - view: text, markup, annotated - select for diffs
Tue Feb 14 14:46:22 2006 UTC (5 years, 11 months ago) by luigi
Branches: RELENG_6
CVS tags: RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.153.2.5: preferred, colored; branchpoint 1.153: preferred, colored
Changes since revision 1.153.2.5: +16 -6 lines
MFC: make sure the start and end markers are contiguous and
     not suppressed by the optimizer.

Approved by: re

Revision 1.162: download - view: text, markup, annotated - select for diffs
Tue Jan 31 13:35:30 2006 UTC (6 years ago) by luigi
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +14 -4 lines
make sure that the start and end preloaded MFS markers are
in contiguous strings, and that the compiler does not optimize them
away because it thinks they are unused.

Revision 1.153.2.5: download - view: text, markup, annotated - select for diffs
Mon Jan 30 23:03:44 2006 UTC (6 years ago) by pjd
Branches: RELENG_6
Diff to: previous 1.153.2.4: preferred, colored; branchpoint 1.153: preferred, colored
Changes since revision 1.153.2.4: +1 -1 lines
MFC:	sys/dev/md/md.c	1.161

Call NDFREE() only when vn_open() succeeded.

Revision 1.161: download - view: text, markup, annotated - select for diffs
Fri Jan 27 11:27:55 2006 UTC (6 years ago) by pjd
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +1 -1 lines
Call NDFREE() only when vn_open() succeeded.

MFC after:	3 days

Revision 1.160: download - view: text, markup, annotated - select for diffs
Wed Dec 28 15:18:18 2005 UTC (6 years, 1 month ago) by maxim
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +2 -2 lines
o Fix typos in the comments.

Submitted by:	Wojciech A. Koszek

Revision 1.159: download - view: text, markup, annotated - select for diffs
Mon Oct 31 15:41:19 2005 UTC (6 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +2 -2 lines
Normalize a significant number of kernel malloc type names:

- Prefer '_' to ' ', as it results in more easily parsed results in
  memory monitoring tools such as vmstat.

- Remove punctuation that is incompatible with using memory type names
  as file names, such as '/' characters.

- Disambiguate some collisions by adding subsystem prefixes to some
  memory types.

- Generally prefer lower case to upper case.

- If the same type is defined in multiple architecture directories,
  attempt to use the same name in additional cases.

Not all instances were caught in this change, so more work is required to
finish this conversion.  Similar changes are required for UMA zone names.

Revision 1.153.2.4: download - view: text, markup, annotated - select for diffs
Fri Oct 7 15:08:41 2005 UTC (6 years, 4 months ago) by phk
Branches: RELENG_6
CVS tags: RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Diff to: previous 1.153.2.3: preferred, colored; branchpoint 1.153: preferred, colored
Changes since revision 1.153.2.3: +5 -6 lines
MFC:
	make sure the type is set early enough for the kthread to know
	to grab Giant for vnode backed devices.

Approved by:	re@ (scottl)

Revision 1.158: download - view: text, markup, annotated - select for diffs
Thu Oct 6 19:47:04 2005 UTC (6 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +5 -6 lines
Make sure that the worker thread knows the type early enough to
grab Giant for vnode backing.

Found by:	pho & tegge

Revision 1.153.2.3: download - view: text, markup, annotated - select for diffs
Mon Sep 26 18:14:38 2005 UTC (6 years, 4 months ago) by phk
Branches: RELENG_6
Diff to: previous 1.153.2.2: preferred, colored; branchpoint 1.153: preferred, colored
Changes since revision 1.153.2.2: +81 -117 lines
MFC:
	Fixes for various races in md.

Approved by:	re@ (scottl)

Revision 1.157: download - view: text, markup, annotated - select for diffs
Mon Sep 19 06:55:27 2005 UTC (6 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +80 -116 lines
Fix configuration locking in MD.

Remove  md_mtx.

Remove GIANT from the mdctl device driver and avoid DROP_GIANT,
PICKUP_GIANT and geom events since we can call into GEOM directly
now.

Pick up Giant around vn_close().

Apply an exclusive sx around mdctls ioctl and preloading to protect
lists etc..

Don't initialize our lock (md_mtx or md_sx) from a
SYSINIT when there is a perfectly good pair of _fini/_init
functions to do it from.

Prune any final fractional sector from the mediasize to
keep GEOM happy.

Cleanups:

Unify MDIOVERSION check in (x)mdctlioctl()

Add pointer to start() routine to softc to eliminate a switch{}

Inline guts of mddetach().

Always pass error pointer to mdnew(), simplify implementation.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Sun Sep 11 12:35:32 2005 UTC (6 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +1 -1 lines
Do not destroy the queue mutex until the thread is done with it.

Revision 1.153.2.2: download - view: text, markup, annotated - select for diffs
Fri Sep 9 21:39:47 2005 UTC (6 years, 5 months ago) by csjp
Branches: RELENG_6
Diff to: previous 1.153.2.1: preferred, colored; branchpoint 1.153: preferred, colored
Changes since revision 1.153.2.1: +8 -8 lines
MFC md.c rev 1.154
MFC mdconfig.c rev 1.44

Dont allow read only backing stores to be modified

PR:		kern/84635
Approved by:	re (kensmith)

Revision 1.153.2.1: download - view: text, markup, annotated - select for diffs
Sat Sep 3 16:02:37 2005 UTC (6 years, 5 months ago) by pjd
Branches: RELENG_6
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +37 -25 lines
MFC:	sys/dev/md/md.c	1.155

- Add md_mtx lock to protect ID number and list of devices.
- Always check mdnew() return value, as even in !autounit case
  kthread_create() can fail.

Those two changes fix serval panics provoked by simple stress test.

Tested by:	Kris The BugMagnet
Approved by:	re (scottl)

Revision 1.155: download - view: text, markup, annotated - select for diffs
Wed Aug 31 19:45:11 2005 UTC (6 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +37 -25 lines
- Add md_mtx lock to protect ID number and list of devices.
- Always check mdnew() return value, as even in !autounit case
  kthread_create() can fail.

Those two changes fix serval panics provked by simple stress test.

Tested by:	Kris The BugMagnet
MFC after:	3 days

Revision 1.154: download - view: text, markup, annotated - select for diffs
Wed Aug 17 01:24:55 2005 UTC (6 years, 5 months ago) by csjp
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +8 -8 lines
Ensure that file flags such as schg, sappnd (and others) are honored
by md(4). Before this change, it was possible to by-pass these flags
by creating memory disks which used a file as a backing store and
writing to the device.

This was discussed by the security team, and although this is problematic,
it was decided that it was not critical as we never guarantee that root will
be restricted.

This change implements the following behavior changes:

-If the user specifies the readonly flag, unset write operations before
 opening the file. If the FWRITE mask is unset, the device will be
 created with the MD_READONLY mask set. (readonly)
-Add a check in g_md_access which checks to see if the MD_READONLY mask
 is set, if so return EROFS
-Do not gracefully downgrade access modes without telling the user. Instead
 make the user specify their intentions for the device (assuming the file is
 read only). This seems like the more correct way to handle things.

This is a RELENG_6 candidate.

PR:		kern/84635
Reviewed by:	phk

Revision 1.127.2.5: download - view: text, markup, annotated - select for diffs
Mon Feb 28 19:32:23 2005 UTC (6 years, 11 months ago) by phk
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.127.2.4: preferred, colored; branchpoint 1.127: preferred, colored; next MAIN 1.128: preferred, colored
Changes since revision 1.127.2.4: +0 -2 lines
MFC:
	Stall threads before they exit or return to userland until
	any geom events they have created have finished rattling.

Revision 1.153: download - view: text, markup, annotated - select for diffs
Sun Feb 13 21:51:50 2005 UTC (6 years, 11 months ago) by alc
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +6 -1 lines
Request a CPU private mapping from sf_buf_alloc().  If the swap-backed
memory disk is larger than the number of available sf_bufs, this improves
performance on SMPs by eliminating interprocessor TLB shootdowns.  For
example, with 6656 sf_bufs, the default on my test machine, and a 256MB
swap-backed memory disk, I see the command
"dd if=/dev/md0 of=/dev/null bs=64k" achieve ~489MB/sec with the default,
shared mappings, and ~587MB/sec with CPU private mappings.

Revision 1.127.2.4: download - view: text, markup, annotated - select for diffs
Sun Jan 30 00:59:53 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.127.2.3: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.3: +2 -2 lines
MFC: /*- and my license changes for sys/[a-d]*

Revision 1.152: download - view: text, markup, annotated - select for diffs
Sat Jan 29 16:48:35 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +1 -1 lines
Use MAXMINOR

Revision 1.151: download - view: text, markup, annotated - select for diffs
Sat Jan 22 19:56:03 2005 UTC (7 years ago) by pjd
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +1 -4 lines
- Don't destroy UMA zone on error in mdcreate_malloc(), because we need it
  in mddestroy() to properly free already allocated memory.
  This fixes a panic when we want to create too big memory backed device
  with preallocate memory (-o reserve).
- Remove redundant { }.

MFC after:	1 week

Revision 1.150: download - view: text, markup, annotated - select for diffs
Sat Jan 22 19:08:50 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +2 -0 lines
Add a couple of mtx_asserts() to try to narrow down the window on
a bug repeatedly reported.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Thu Jan 6 01:42:55 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +2 -2 lines
Start each of the license/copyright comments with /*-, minor shuffle of lines

Revision 1.148: download - view: text, markup, annotated - select for diffs
Wed Jan 5 05:32:52 2005 UTC (7 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +6 -0 lines
Add needed synchronization to the error handling code that was introduced
in revision 1.141.

Lock assertion failures reported by: Kris Kennaway

Revision 1.147: download - view: text, markup, annotated - select for diffs
Thu Dec 30 20:29:58 2004 UTC (7 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +4 -1 lines
Stop explicitly touching td_base_pri outside of the scheduler and simply
set a thread's priority via sched_prio() when that is the desired action.
The schedulers will start managing td_base_pri internally shortly.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Mon Dec 27 17:20:06 2004 UTC (7 years, 1 month ago) by pjd
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +8 -10 lines
Rewrite piece of code which I committed some time ago that allows to
show file name for 'mdconfig -l -u <x>' command.
This allows to preserve API/ABI compatibility with version 0 (that's why
I changed version number back to 0) and will allow to merge this change
to RELENG_5.

MFC after:	5 days

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sat Nov 13 05:00:12 2004 UTC (7 years, 2 months ago) by marcel
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +1 -1 lines
Fix the MDIOCDETACH ioctl() for md(4). Now that the md_file field in
the mdio structure is an array and not a pointer, we cannot test for
it to be NULL. It never is. Instead, test for md_file[0] to be '\0'.

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sat Nov 6 13:16:35 2004 UTC (7 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +5 -5 lines
Be consistent and use 'if (error != 0)' instead of 'if (error)' everywhere.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sat Nov 6 13:07:02 2004 UTC (7 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +13 -4 lines
For file backed md(4) devices output their source file via
'mdconfig -l -u <unit>'.
Bump version number, as this change breaks ABI/API.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Sat Oct 23 20:50:06 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +0 -2 lines
Don't explicitly call g_waitidle(), it happens automagically now.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Tue Oct 12 04:47:16 2004 UTC (7 years, 3 months ago) by green
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +19 -1 lines
Account for failure in vm_pager_allocate() or vm_pager_get_pages() in
md(8).  The former is generally not going to fail, but the latter can
fail when the underlying swap device returns an error.

There are still plenty of other places where vm_pager_get_pages() failing
will lead directly to crashes, so it's a good idea to put your swap on
RAID if you care enough to put any of your disks on RAID....

Revision 1.140: download - view: text, markup, annotated - select for diffs
Sat Sep 18 09:16:19 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +1 -1 lines
Actually this order (unlock, wakeup) in this case is race-safe and can
save us 2 context switches.

Explained by:	njl

Revision 1.139: download - view: text, markup, annotated - select for diffs
Thu Sep 16 21:32:13 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +89 -161 lines
- Make md(4) 64-bit clean.
  After this change it should be possible to use very big md(4) devices.
- Clean up and simplify the code a bit.
- Use humanize_number(3) to print size of md(4) devices.
- Add 't' suffix which stands for terabyte.
- Make '-S' to really work with all types of devices.
- Other minor changes.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Thu Sep 16 20:38:11 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +8 -8 lines
There is no need to keep 'npage' value inside our softc structure,
it is only used in one function. While doing so, change its type to
vm_ooffset_t.
We are still limited for swap-backed devices to 16TB on 32-bit architectures
where PAGE_SIZE is 4096 bytes.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Thu Sep 16 19:42:17 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +14 -13 lines
- Do not use bio_pblkno as it is going away anyway.
- Prefer bio_length than bio_bcount.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Thu Sep 16 18:59:19 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +1 -2 lines
First wakeup, then unlock.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Thu Sep 16 18:56:20 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +2 -2 lines
Type 'int' is too small for 'i' and 'lastp' variables. Use proper type,
which is vm_pindex_t (unsigned 64bit on i386).

Revision 1.134: download - view: text, markup, annotated - select for diffs
Tue Sep 14 19:55:07 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +2 -0 lines
Deallocate VM object on failure.

Revision 1.133: download - view: text, markup, annotated - select for diffs
Tue Sep 14 19:27:59 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +1 -0 lines
One more missing NDFREE(9).

Revision 1.132: download - view: text, markup, annotated - select for diffs
Tue Sep 14 18:43:24 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +4 -2 lines
- Don't forget about NDFREE() in case of vn_open() failure.
- Don't forget about vn_close() in case of failure.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Tue Sep 14 18:32:05 2004 UTC (7 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +1 -0 lines
Fix UMA zone leak.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Tue Sep 7 07:54:45 2004 UTC (7 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +1 -3 lines
Use bioq_takefirst()

Revision 1.127.2.3: download - view: text, markup, annotated - select for diffs
Thu Sep 2 20:08:41 2004 UTC (7 years, 5 months ago) by cperciva
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Diff to: previous 1.127.2.2: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.2: +2 -0 lines
MFC rev. 1.129.  (Attempt #2 to fix this problem without breaking
anything else.)

When creating a new md, g_waitidle() to make sure the /dev entry gets
created before mdconfig(8) returns, *but only if it's not a preloaded
md*.

Approved by:	re (kensmith)

Revision 1.129: download - view: text, markup, annotated - select for diffs
Mon Aug 30 08:38:30 2004 UTC (7 years, 5 months ago) by cperciva
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +2 -1 lines
Don't g_waitidle() when initializing a preloaded md.  This fixes a
deadlock which otherwise occurs during the boot process.

Reported by:	kensmith
MFC after:	3 days
		(assuming that re@ approves)

Revision 1.127.2.2: download - view: text, markup, annotated - select for diffs
Sat Aug 28 19:54:50 2004 UTC (7 years, 5 months ago) by kensmith
Branches: RELENG_5
Diff to: previous 1.127.2.1: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.1: +0 -1 lines
Back out the MFC done as rev 1.127.2.1.  It seems to fix the problem of
mdconfig returning before the device's name appears in /dev but it seems
to cause a worse problem.  When booting the installation media (CD or
boot floppies) the system hangs after the device probes, at the point
it should be trying to mount a MD-based filesystem as its root filesystem.
Backing out this patch solves that problem, allowing it to proceed to
the sysinstall menu.

Approved by:	re (rwatson)

Revision 1.127.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 25 20:20:00 2004 UTC (7 years, 5 months ago) by cperciva
Branches: RELENG_5
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +1 -0 lines
MFC rev. 1.128: Insert a g_waitidle() call in order to ensure that new
memory disks appear in /dev before mdconfig(8) returns.

Approved by:	re (kensmith)

Revision 1.128: download - view: text, markup, annotated - select for diffs
Sun Aug 22 19:44:24 2004 UTC (7 years, 5 months ago) by cperciva
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +1 -0 lines
When creating a new md, wait for geom's event queue to become empty
before returning.  Device nodes are created via the "taste" mechanism,
so this is necessary in order to make sure that devfs entries are
created before mdconfig(8) returns.

This may be a MFC candidate for 5.3.

Suggested by:	phk

Revision 1.127: download - view: text, markup, annotated - select for diffs
Sun Aug 8 07:57:50 2004 UTC (7 years, 6 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +1 -0 lines
Tag all geom classes in the tree with a version number.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Sun Aug 8 06:47:43 2004 UTC (7 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +19 -40 lines
Use a ->fini() from the geom class to destroy the control device.
Use default initialization of geom methods.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Thu Jul 15 08:26:02 2004 UTC (7 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +1 -0 lines
Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".

Revision 1.124: download - view: text, markup, annotated - select for diffs
Wed Jun 16 09:46:50 2004 UTC (7 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +3 -3 lines
Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Tue May 18 07:30:04 2004 UTC (7 years, 8 months ago) by pjd
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +1 -2 lines
Fix panic which occurs when given sector size for memory-backed device
is less than DEV_BSIZE (512) bytes.

Reported by:	Mike Bristow <mike@urgle.com>
Approved by:	phk

Revision 1.122: download - view: text, markup, annotated - select for diffs
Fri Apr 9 05:12:47 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +4 -0 lines
Ooops, removed this acknowledgement bogusly.

Eagle Eyes: bde

Revision 1.121: download - view: text, markup, annotated - select for diffs
Wed Apr 7 20:45:57 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +0 -8 lines
Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sat Apr 3 09:16:25 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +1 -1 lines
In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it
should not.  Add a new parameter so that the caller can specify which is
the case.

Reported by:	dillon

Revision 1.119: download - view: text, markup, annotated - select for diffs
Wed Mar 31 21:48:02 2004 UTC (7 years, 10 months ago) by luigi
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +3 -14 lines
Fix a bug with preloaded image -- for some reason [that i don't
completely understand], md_takeroot() runs before md_preloaded(),
rendering both useless.
As a fix, move the body (effectively one line!) of md_takeroot()
into md_preloaded(), and get rid of the stuff that has become useless.

Bug and fix reported 10 days ago on -current, no reply.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Fri Mar 19 21:19:15 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +58 -72 lines
 - Remove some unused #includes.
 - Apply some style fixes to mdstart_swap().

Revision 1.117: download - view: text, markup, annotated - select for diffs
Thu Mar 18 18:23:37 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +9 -9 lines
Utilize sf_buf_alloc() and sf_buf_free() to implement the ephemeral
mappings required by mdstart_swap().  On i386, if the ephemeral mapping
is already in the sf_buf mapping cache, a swap-backed md performs
similarly to a malloc-backed md.  Even if the ephemeral mapping is not
cached, this implementation is still faster.  On 64-bit platforms, this
change has the effect of using the direct virtual-to-physical mapping,
avoiding ephemeral mapping overheads, such as TLB shootdowns on SMPs.

On a 2.4GHz, 400MHz FSB P4 Xeon configured with 64K sf_bufs and
"mdmfs -S -o async -s 128m md /mnt"

before:
dd if=/dev/md0 of=/dev/null bs=64k
134217728 bytes transferred in 0.430923 secs (311465697 bytes/sec)

after with cold sf_buf cache:
dd if=/dev/md0 of=/dev/null bs=64k
134217728 bytes transferred in 0.367948 secs (364773576 bytes/sec)

after with warm sf_buf cache:
dd if=/dev/md0 of=/dev/null bs=64k
134217728 bytes transferred in 0.252826 secs (530870010 bytes/sec)

malloc-backed md:
dd if=/dev/md0 of=/dev/null bs=64k
134217728 bytes transferred in 0.253126 secs (530240978 bytes/sec)

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sun Mar 14 00:24:30 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +1 -3 lines
Allow swap-backed devices to run without Giant.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Wed Mar 10 20:41:08 2004 UTC (7 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +5 -3 lines
Fix a long-standing deadlock issue with vnode backed md(4) devices:

On vnode backed md(4) devices over a certain, currently undetermined
size relative to the buffer cache our "lemming-syncer" can provoke
a buffer starvation which puts the md thread to sleep on wdrain.

This generally tends to grind the entire system to a stop because the
event that is supposed to wake up the thread will not happen until a fair
bit of the piled up I/O requests in the system finish, and since a lot
of those are on a md(4) vnode backed device which is currently waiting
on wdrain until a fair amount of the piled up ... you get the picture.

The cure is to issue all VOP_WRITES on the vnode backing the device
with IO_SYNC.

In addition to more closely emulating a real disk device with a
non-lying write-cache, this makes the writes exempt from rate-limited
(there to avoid starving the buffer cache) and consequently prevents
the deadlock.

Unfortunately performance takes a hit.

Add "async" option to give people who know what they are doing the
old behaviour.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Fri Mar 5 22:42:16 2004 UTC (7 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +2 -2 lines
kthread_exit() no longer requires Giant, so don't force callers to acquire
Giant just to call kthread_exit().

Requested by:	many

Revision 1.113: download - view: text, markup, annotated - select for diffs
Tue Mar 2 20:13:23 2004 UTC (7 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +4 -0 lines
Make swapbacked md(4) devices respect the -x and -y emulation arguments.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Sun Feb 29 15:58:54 2004 UTC (7 years, 11 months ago) by cperciva
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +49 -19 lines
Use DEV_BSIZE byte sectors instead of PAGE_SIZE byte sectors for
swap-backed memory disks.  This reduces filesystem allocation overhead
and makes swap-backed memory disks compatible with broken code (dd,
for example) which expects to see 512 byte sectors.  The size of a
swap-backed memory disk must still be a multiple of the page size.

When performing page-aligned operations, this change has zero
performance impact.

Reviewed by:	phk
Approved by:	rwatson (mentor)

Revision 1.111: download - view: text, markup, annotated - select for diffs
Sat Feb 21 21:10:44 2004 UTC (7 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +2 -0 lines
Device megapatch 4/6:

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.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Mon Jan 12 10:52:00 2004 UTC (8 years ago) by phk
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +4 -0 lines
Allow specification of a geometry for vnode backed devices as well as
for malloc backed devices.

Revision 1.108.2.1: download - view: text, markup, annotated - select for diffs
Wed Dec 17 19:48:00 2003 UTC (8 years, 1 month ago) by phk
Branches: RELENG_5_2
CVS tags: RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE
Diff to: previous 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108: +1 -1 lines
MFC: make preloaded filesystems work with md(4) again.

Approved by:	re@(scottl)

Revision 1.109: download - view: text, markup, annotated - select for diffs
Sat Dec 13 18:12:58 2003 UTC (8 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +3 -6 lines
Fix a locking problem with MD_ROOT_SIZE.

Retire md(4)'s static major number.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Tue Nov 18 18:19:26 2003 UTC (8 years, 2 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_2_BP
Branch point for: RELENG_5_2
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +6 -2 lines
Use the class->init() to hitch up preload devices, rather than rely on
the "old" SYSINIT.  This makes sure things happen in the right order.

XXX: md(4) needs to be fully geom-ified and in particluar /dev/md.ctl
should be abandonded for the GEOM OaM api.

Approved by:	re@

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sat Oct 18 11:25:42 2003 UTC (8 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +0 -1 lines
Don't initialize unused bio_blkno field.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Sep 27 12:00:59 2003 UTC (8 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +0 -2 lines
The present defaults for the open and close for device drivers which
provide no methods does not make any sense, and is not used by any
driver.

It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.

Change the defaults to be nullopen() and nullclose() which simply
does nothing.

Remove explicit initializations to these from the drivers which
already used them.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Thu Aug 7 15:04:25 2003 UTC (8 years, 6 months ago) by jhb
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +4 -4 lines
Consistently use the BSD u_int and u_short instead of the SYSV uint and
ushort.  In most of these files, there was a mixture of both styles and
this change just makes them self-consistent.

Requested by:	bde (kern_ktrace.c)

Revision 1.104: download - view: text, markup, annotated - select for diffs
Tue Aug 5 06:54:44 2003 UTC (8 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +58 -22 lines
Change the implementation of swap backing to use the VM system in normal
ways, and drop the need for vm_pager_strategy().

Revision 1.103: download - view: text, markup, annotated - select for diffs
Sun Jul 27 17:04:54 2003 UTC (8 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +2 -2 lines
Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sun Jun 22 11:31:38 2003 UTC (8 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +0 -2 lines
Remove 256 unit limit, there is no evil minor number encoding to
deal with any more.

Spotted by:	"Darren Freestone" <df@cops.org>

Revision 1.101: download - view: text, markup, annotated - select for diffs
Sat May 31 16:59:26 2003 UTC (8 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +0 -1 lines
Remove the G_CLASS_INITIALIZER, we do not need it anymore.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Sat May 31 16:42:44 2003 UTC (8 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +2 -3 lines
The IO_NOWDRAIN and B_NOWDRAIN hacks are no longer needed to prevent
deadlocks with vnode backed md(4) devices because md now uses a
kthread to run the bio requests instead of doing it directly from
the bio down path.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri May 16 07:28:27 2003 UTC (8 years, 8 months ago) by alc
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +2 -2 lines
Use vm_object_deallocate(), not vm_pager_deallocate(), to destroy a
vm object.  (vm_pager_deallocate() does not, in fact, destroy a vm object.)

Approved by:	re (scottl)
Reviewed by:	phk

Revision 1.98: download - view: text, markup, annotated - select for diffs
Fri May 2 06:18:58 2003 UTC (8 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +13 -3 lines
Call g_wither_geom(), instead of just setting the flag.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Wed Apr 9 11:59:29 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +33 -22 lines
Add a couple of undocumented test options to MD(4) to aid in regression
testting of GEOM.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Thu Apr 3 19:19:36 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +0 -1 lines
Remove all references to BIO_SETATTR.  We will not be using it.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Tue Apr 1 15:06:24 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +1 -1 lines
Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now.

Spell bioq_disksort() consistently with the remaining bioq_*().

#include <geom/geom_disk.h> where this is more appropriate.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Tue Apr 1 13:33:28 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +0 -2 lines
Don't include <sys/disk.h>.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sat Mar 29 22:13:32 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +0 -1 lines
remove a blank line.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Thu Mar 27 10:14:36 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +6 -2 lines
Allocate the toplevel indir with M_WAITOK to avoid complicating things
needlessly.

Detected by:	rwatsons EvilMalloc(9)

Revision 1.91: download - view: text, markup, annotated - select for diffs
Mon Mar 24 19:46:26 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +1 -3 lines
Change g_class initialization to sparse format.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Tue Mar 18 08:45:21 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +0 -1 lines
Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Mar 8 08:01:28 2003 UTC (8 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +0 -14 lines
Centralize the devstat handling for all GEOM disk device drivers
in geom_disk.c.

As a side effect this makes a lot of #include <sys/devicestat.h>
lines not needed and some biofinish() calls can be reduced to
biodone() again.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Mon Mar 3 13:04:59 2003 UTC (8 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +7 -1 lines
Add a "-S sectorsize" option to enable Kirk to find a bug :-)

Revision 1.87: download - view: text, markup, annotated - select for diffs
Mon Mar 3 12:15:43 2003 UTC (8 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +5 -10 lines
Gigacommit to improve device-driver source compatibility between

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)

Revision 1.86: download - view: text, markup, annotated - select for diffs
Wed Feb 19 05:47:07 2003 UTC (8 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +2 -2 lines
Back out M_* changes, per decision of the TRB.

Approved by: trb

Revision 1.85: download - view: text, markup, annotated - select for diffs
Tue Feb 11 12:35:44 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +14 -8 lines
Mark our provider with G_PF_CANDELETE in the cases where this is actually
the case.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Thu Jan 30 13:12:31 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +0 -111 lines
NO_GEOM cleanup: unifdef

Revision 1.83: download - view: text, markup, annotated - select for diffs
Mon Jan 27 07:58:18 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +11 -0 lines
Implement MDIOCLIST which returns the unit numbers of configured md(4)
devices.

We use the md_pad[] array and if there are more units than its size the
last returned unit number will be -1, but the number of units returned
is correct.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Jan 21 08:55:35 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +2 -2 lines
Remove M_TRYWAIT/M_WAITOK/M_WAIT.  Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Mon Jan 13 20:19:04 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +3 -3 lines
OK Ok, so I didn't check the NO_GEOM case for the final version...

Stumbled on by:	bde

Revision 1.80: download - view: text, markup, annotated - select for diffs
Mon Jan 13 17:31:46 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +0 -3 lines
Enable the new h0h0magic code which on GEOM kernels make the md(4)
driver a _real_ GEOM driver.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Mon Jan 13 08:50:23 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +28 -12 lines
Add a mutex around the per unit bioqueue.

Only grab giant in the per unit kthread for SWAP and VNODE backed devices.

Initialize the bioq before the kthread gets a chance to study it.

Don't lock Giant in mddone_swap, we shouldn't need it.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Jan 13 08:01:09 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +0 -1 lines
Remove the printf which announces the creation of malloc disks: it is
inconsistent when we do not do it for swap or vnode.

We still printf for preloaded disks because of the weak debugging
options people have in embedded/tiny environments where this is
usually used.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sun Jan 12 21:16:49 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +134 -4 lines
Add code to make md(4) a GEOM device driver instead of relying in
the disk mini-layer.

This is currently not enabled.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Sun Jan 12 17:39:29 2003 UTC (9 years ago) by phk
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +48 -43 lines
Shift things around a bit in preparation for future evilness.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Sat Nov 30 22:03:53 2002 UTC (9 years, 2 months ago) by iedowse
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +1 -1 lines
Move the check for the MD_SHUTDOWN flag to before the tsleep() call
in the per-device kthread. This ensures that synchronisation with
mddestroy() succeeds even if the kthread was not waiting in tsleep()
at the time of the wakeup(). Among other things, this fixes the
problem of mdconfig getting stuck when an attempt is made to use a
zero-length file as a vnode-type backing store.

Approved by:	re

Revision 1.74: download - view: text, markup, annotated - select for diffs
Mon Oct 21 20:08:28 2002 UTC (9 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +1 -1 lines
We want /dev/md0 for ramdisk roots, not /dev/md0c.

Sponsored by:	DARPA & NAI Labs

Revision 1.73: download - view: text, markup, annotated - select for diffs
Sun Oct 20 20:50:31 2002 UTC (9 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +5 -3 lines
Use ENOSPC error return, not ENOMEM.

Use %jd rather than %lld.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sun Oct 13 18:19:22 2002 UTC (9 years, 3 months ago) by jake
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +1 -1 lines
MODINFO_SIZE metadata has type size_t, not unsigned.  This makes preloaded
md root work on sparc64.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Oct 2 07:44:18 2002 UTC (9 years, 4 months ago) by scottl
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +1 -1 lines
Some kernel threads try to do significant work, and the default KSTACK_PAGES
doesn't give them enough stack to do much before blowing away the pcb.
This adds MI and MD code to allow the allocation of an alternate kstack
who's size can be speficied when calling kthread_create.  Passing the
value 0 prevents the alternate kstack from being created.  Note that the
ia64 MD code is missing for now, and PowerPC was only partially written
due to the pmap.c being incomplete there.
Though this patch does not modify anything to make use of the alternate
kstack, acpi and usb are good candidates.

Reviewed by:	jake, peter, jhb

Revision 1.70: download - view: text, markup, annotated - select for diffs
Sat Sep 28 14:17:24 2002 UTC (9 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +1 -1 lines
Put the casts on the right hand side of =.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sun Sep 22 10:07:18 2002 UTC (9 years, 4 months ago) by grehan
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +2 -2 lines
Initialize fwsectors/fwheads to allow the DIOCGFWSECTORS and
DIOCGFWHEADS ioctls to return meaningful values to disklabel/newfs

Approved by: phk

Revision 1.68: download - view: text, markup, annotated - select for diffs
Fri Sep 20 19:35:59 2002 UTC (9 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +5 -10 lines
(This commit touches about 15 disk device drivers in a very consistent
and predictable way, and I apologize if I have gotten it wrong anywhere,
getting prior review on a patch like this is not feasible, considering
the number of people involved and hardware availability etc.)

If struct disklabel is the messenger: kill the messenger.

Inside struct disk we had a struct disklabel which disk drivers used to
communicate certain metrics to the disklayer above (GEOM or the disk
mini-layer).  This commit changes this communication to use four
explicit fields instead.

Amongst the benefits is that the fields do not get overwritten by
wrong or bogus on-disk disklabels.

Once that is clear, <sys/disk.h> which is included in the drivers
no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in,
the few places that needs them, have gotten explicit #includes for
them.

The disklabel inside struct disk is now only for internal use in
the disk mini-layer, so instead of embedding it, we malloc it as
we need it.

This concludes (modulus any mistakes) the series of disklabel related
commits.

I belive it all amounts to a NOP for all the rest of you :-)

Sponsored by:   DARPA & NAI Labs.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Thu Aug 22 21:23:59 2002 UTC (9 years, 5 months ago) by archie
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +1 -1 lines
Replace (ab)uses of "NULL" where "0" is really meant.

Revision 1.8.2.2: download - view: text, markup, annotated - select for diffs
Mon Aug 19 17:43:34 2002 UTC (9 years, 5 months ago) by jdp
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.8.2.1: preferred, colored; branchpoint 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8.2.1: +12 -7 lines
MFC 1.12: Fix the "almost clone" semantics of the md device.  This
also fixes problems with using more than one preloaded md_image
module.

Reviewed by:	phk

Revision 1.66: download - view: text, markup, annotated - select for diffs
Mon Jun 24 12:07:02 2002 UTC (9 years, 7 months ago) by mux
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -2 lines
Yet another warning fix for 64 bits platforms.

Reviewed by:	phk

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sat Jun 15 19:18:43 2002 UTC (9 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +2 -2 lines
mdcreate_vnode() isn't correctly clearing things out of the linked
list if the file is of 0 size or mdsetcred() fails.

Submitted by:	Martin Faxer <gmh003532@brfmasthugget.se>

Revision 1.64: download - view: text, markup, annotated - select for diffs
Mon Jun 10 19:25:21 2002 UTC (9 years, 8 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +6 -8 lines
- Whitespace only: use return statement consistentlt (return (foo), not
  return(foo)), kill extra blank names between function names;
- fix format string in printf(): devtoname() returns string, not pointer.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Mon Jun 3 22:09:04 2002 UTC (9 years, 8 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +36 -11 lines
Use a per-device worker thread to avoid blocking in mdstrategy()
until the I/O completes. This fixes some easily reproducable deadlocks
that occur when using md(4) with GEOM.

Reviewed by:	phk

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sun May 26 09:57:59 2002 UTC (9 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +1 -0 lines
Mis-edit in last commit.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sun May 26 09:38:51 2002 UTC (9 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +21 -21 lines
Be a bit smarter about rewriting data so we don't loose too much performance.

Sponsored by: DARPA & NAI Labs.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sun May 26 06:48:55 2002 UTC (9 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +32 -14 lines
Use an umazone per unit for allocating the sectors for malloc backing.

Clean up things properly when we unconfigure malloc backed units.

Sponsored by:	DARPA & NAI Labs.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Sat May 25 20:44:20 2002 UTC (9 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +225 -64 lines
Give the "malloc" backing of md(4) an adaptive multilevel index tree to
remove the need for a contiguous array with pointers to all the sectors.

Try to make failure to malloc(9) memory a non-hang situation.

Eventually this will allow us to test the 64bit cleanness of the disk
I/O patch, but more work is outstanding here and elsewhere.

Sponsored by:	DARPA & NAI Labs.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Fri May 3 17:55:10 2002 UTC (9 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +16 -13 lines
Fix a memory-leak when configuring a vnode backed md(4) device fails.

Submitted by:	Martin Faxér <gmh003532@brfmasthugget.se>
MFC after:	4 weeks

Revision 1.57: download - view: text, markup, annotated - select for diffs
Wed Mar 20 09:55:07 2002 UTC (9 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +0 -1 lines
Remove unused include.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Tue Mar 19 04:07:29 2002 UTC (9 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +3 -3 lines
The previous commit missed fixing 2 old printf format errors and
introduced a format printf error.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Tue Mar 19 01:45:04 2002 UTC (9 years, 10 months ago) by gallatin
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +2 -1 lines
Fix printf warning caused by recent changes in bio_pblkno's type.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Fri Mar 15 18:49:43 2002 UTC (9 years, 10 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +1 -1 lines
Introduce the new 64-bit size disk block, daddr64_t. Change
the bio and buffer structures to have daddr64_t bio_pblkno,
b_blkno, and b_lblkno fields which allows access to disks
larger than a Terabyte in size. This change also requires
that the VOP_BMAP vnode operation accept and return daddr64_t
blocks. This delta should not affect system operation in
any way. It merely sets up the necessary interfaces to allow
the development of disk drivers that work with these larger
disk block addresses. It also allows for the development of
UFS2 which will use 64-bit block addresses.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Wed Feb 27 18:31:43 2002 UTC (9 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +6 -7 lines
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sun Feb 10 21:42:44 2002 UTC (10 years ago) by phk
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
Staticize the malloc definitions.

Obtained from:	~bde/sys.dif.gz

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon Jan 21 20:57:03 2002 UTC (10 years ago) by phk
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +122 -122 lines
Gah! last commit botched indentation, fix indentation and some other
white-space nits while at it.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Jan 21 20:50:06 2002 UTC (10 years ago) by phk
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +34 -77 lines
Restructure slightly, eliminating some repetitive source lines and
making GEOM patches simpler and more readable at the same time.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Thu Dec 20 06:38:21 2001 UTC (10 years, 1 month ago) by dd
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +13 -0 lines
Actually make use of the md_version field of 'struct mdio'.  In order
not to needlessly break compatibility, decrement MDIOVERSION to 0.

Approved by:	phk

Revision 1.48: download - view: text, markup, annotated - select for diffs
Mon Nov 5 18:48:53 2001 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +8 -5 lines
Implement IO_NOWDRAIN and B_NOWDRAIN - prevents the buffer cache from blocking
in wdrain during a write.  This flag needs to be used in devices whos
strategy routines turn-around and issue another high level I/O, such as
when MD turns around and issues a VOP_WRITE to vnode backing store, in order
to avoid deadlocking the dirty buffer draining code.

Remove a vprintf() warning from MD when the backing vnode is found to be
in-use.  The syncer of buf_daemon could be flushing the backing vnode at
the time of an MD operation so the warning is not correct.

MFC after:	1 week

Revision 1.47: download - view: text, markup, annotated - select for diffs
Thu Oct 11 23:38:13 2001 UTC (10 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +2 -3 lines
Change the kernel's ucred API as follows:
- crhold() returns a reference to the ucred whose refcount it bumps.
- crcopy() now simply copies the credentials from one credential to
  another and has no return value.
- a new crshared() primitive is added which returns true if a ucred's
  refcount is > 1 and false (0) otherwise.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Tue Oct 9 16:37:51 2001 UTC (10 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +3 -2 lines
Use crhold() instead of crdup().  The md(4) driver doesn't modify the ucred
that it uses, so it merely needs to bump its refcount to make it immutable
rather than obtain its own copy.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:37:08 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: KSE_MILESTONE_2
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +37 -36 lines
KSE Milestone 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

Revision 1.44: download - view: text, markup, annotated - select for diffs
Mon Aug 27 17:48:37 2001 UTC (10 years, 5 months ago) by sobomax
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +0 -1 lines
OOPS, remove local change that somehow slipped into a commit (I swear that
I already deleted it some time ago). This should fix problem people have with
unsefined reference to `MD_PRELOAD_COMPRESSED'.

Submitted by:	Manfred Antar <null@pozo.com>

Revision 1.43: download - view: text, markup, annotated - select for diffs
Mon Aug 27 13:25:47 2001 UTC (10 years, 5 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +70 -58 lines
- On module unload try to detach all configured disks and let unload proceed
  if all disks were detached sucessfully;
- use consistent style for return statements and fix several others style
  inconsistencies.

Reviewed by:	ru
Approved by:	phk

Revision 1.42: download - view: text, markup, annotated - select for diffs
Thu Aug 16 03:04:49 2001 UTC (10 years, 5 months ago) by dd
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +2 -2 lines
There is no MD_OBJET disk type, it's actually MD_SWAP.  I guess the
former was either a previous or proposed name that kind of snuck in.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Aug 7 19:23:15 2001 UTC (10 years, 6 months ago) by dd
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +6 -3 lines
Introduce a force option, MD_FORCE, that instructs the driver to
bypass some extra anti-foot-shooting measures.  Currently, its only
effect is to allow detaching a device while it's still open (e.g.,
mounted).  This is useful for testing how the system reacts to a disk
suddenly going away, which can happen with some removeable media.

At this point, the force option is only checked on detach, so it
would've been possible to allow the option to be passed with the
MDIOCDETACH operation.  This was not done to allow the possibility of
having the force flag influence other tests in the future, which may
not necessarily deal with detaching the device.

Reviewed by:	sobomax
Approved by:	phk

Revision 1.40: download - view: text, markup, annotated - select for diffs
Thu Aug 2 10:19:13 2001 UTC (10 years, 6 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +18 -4 lines
- Deny detaching requests until device is still open, otherwise it is possible
  to hang or panic kernel by detaching disk from which fs is mounted;
- replace "md" with MD_NAME in yet another place.

Reviewed by:	phk
Approved by:	phk

Revision 1.39: download - view: text, markup, annotated - select for diffs
Thu Jul 26 20:05:20 2001 UTC (10 years, 6 months ago) by tmm
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +5 -1 lines
Make sure the total number of sectors is not 0 for a vnode-type md to
avoid a division by zero which would occur on open() in this case.

Reviewed by:	phk

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Jul 18 13:32:38 2001 UTC (10 years, 6 months ago) by dd
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +4 -3 lines
Use MD_NAME and MDCTL_NAME constants where appropriate.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Wed Jul 4 16:20:07 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +5 -6 lines
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Jun 25 18:24:52 2001 UTC (10 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +2 -2 lines
We don't need the vm lock to perform a few simple calculations on the
md device's softc.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Tue May 29 18:49:23 2001 UTC (10 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -12 lines
Remove MFS compat bits.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun May 27 00:42:46 2001 UTC (10 years, 8 months ago) by dd
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +8 -2 lines
Acquire vm_mtx before calling vm_pager_deallocate.

Reviewed by:	phk

Revision 1.33: download - view: text, markup, annotated - select for diffs
Mon May 21 18:52:00 2001 UTC (10 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +2 -2 lines
Sort includes.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat May 19 01:28:00 2001 UTC (10 years, 8 months ago) by alfred
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +2 -1 lines
Introduce a global lock for the vm subsystem (vm_mtx).

vm_mtx does not recurse and is required for most low level
vm operations.

faults can not be taken without holding Giant.

Memory subsystems can now call the base page allocators safely.

Almost all atomic ops were removed as they are covered under the
vm mutex.

Alpha and ia64 now need to catch up to i386's trap handlers.

FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).

Reviewed (partially) by: jake, jhb

Revision 1.31: download - view: text, markup, annotated - select for diffs
Tue May 8 09:09:32 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -7 lines
Polish error handling code using biofinish()

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun May 6 19:59:57 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +4 -7 lines
Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror().

Most of this patch is generated by scripts.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sun May 6 17:17:23 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +13 -15 lines
Fix a panic if MD devices were left half-created.

XXX: the real bug is that devstat isn't part of the disk minilayer.

PR:		27158
Submitted by:	Anders Nordby <anders@fix.no>

Revision 1.28: download - view: text, markup, annotated - select for diffs
Tue May 1 08:11:58 2001 UTC (10 years, 9 months ago) by markm
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +8 -6 lines
Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)

Revision 1.27: download - view: text, markup, annotated - select for diffs
Tue Mar 20 12:31:53 2001 UTC (10 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +2 -2 lines
Fix a reference to the "vn" driver in a warning message.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Fri Mar 9 20:06:30 2001 UTC (10 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -2 lines
Use a more BIOS friendly geometry.

Submitted by:	joe

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Feb 25 13:12:57 2001 UTC (10 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +29 -5 lines
Make "md" and "mdctl" macroized parameters.

Implement "-l" option to mdconfig which can list one or all md devices.

Submitted by:   Dima Dorfman <dima@unixfreak.org>

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Feb 24 16:26:41 2001 UTC (10 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +36 -5 lines
Make md/mdconfig do kld.

Submitted by:	dcs

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sun Jan 28 20:55:55 2001 UTC (11 years ago) by phk
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +2 -1 lines
Remove devstat entries in mddelete()

Spotted:	tegge

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun Jan 21 22:57:56 2001 UTC (11 years ago) by phk
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +34 -54 lines
General cleanup.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Fri Jan 19 09:02:40 2001 UTC (11 years ago) by peter
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +2 -2 lines
Fix a maybe-not-so-harmless warning.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Jan 2 09:42:47 2001 UTC (11 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +94 -26 lines
Either cvs(1) or I forgot this file in my last commit.

Please see commit log for rev 1.4 of src/sbin/mdconfig/mdconfig.c

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Dec 31 13:03:42 2000 UTC (11 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +508 -128 lines
This is the first snapshot of the new all-singing-and-dancing md(4).

Using the mdconfig(8) program you can now configure memory disks
on malloc(9), swap or a file/vnode.  preloaded md disks also work
as usual.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Fri Dec 15 16:42:38 2000 UTC (11 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -1 lines
Enforce disk unit numbers upper limit in cloning.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Dec 8 21:49:48 2000 UTC (11 years, 2 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +4 -7 lines
Convert more malloc+bzero to malloc+M_ZERO.

Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Sep 2 19:16:34 2000 UTC (11 years, 5 months ago) by phk
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +6 -18 lines
Avoid the modules madness I inadvertently introduced by making the
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.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Mon Aug 28 21:48:11 2000 UTC (11 years, 5 months ago) by dfr
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +5 -5 lines
* Completely rewrite the alpha busspace to hide the implementation from
  the drivers.
* Remove legacy inx/outx support from chipset and replace with macros
  which call busspace.
* Rework pci config accesses to route through the pcib device instead of
  calling a MD function directly.

With these changes it is possible to cleanly support machines which have
more than one independantly numbered PCI busses. As a bonus, the new
busspace implementation should be measurably faster than the old one.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Aug 20 21:34:30 2000 UTC (11 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +60 -10 lines
  Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)

  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

Revision 1.8.2.1: download - view: text, markup, annotated - select for diffs
Mon Jul 17 13:48:40 2000 UTC (11 years, 6 months ago) by sheldonh
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6, RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5, RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4, RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3, RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -4 lines
MFC: Rename MDNSECT to MD_NSECT and add it to options and LINT.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Jul 17 13:13:04 2000 UTC (11 years, 6 months ago) by sheldonh
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +4 -4 lines
Rename MDNSECT to MD_NSECT and declare it as something that isn't
default in NOTES.

Requested by:	bde
Approved by:	phk

Revision 1.12: download - view: text, markup, annotated - select for diffs
Tue Jul 4 10:06:34 2000 UTC (11 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +12 -7 lines
Fix the "almost clone" semantics.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri May 5 09:57:42 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -2 lines
Separate the struct bio related stuff out of <sys/buf.h> into
<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

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sat Apr 15 05:53:35 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +41 -40 lines
Complete the bio/buf divorce for all code below devfs::strategy

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

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Mar 20 10:44:10 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +7 -7 lines
Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
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.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Wed Dec 1 10:20:21 1999 UTC (12 years, 2 months ago) by phk
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +4 -2 lines
Initialize type correctly.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Nov 26 20:08:38 1999 UTC (12 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +194 -96 lines
Retire MFS_ROOT and MFS_ROOT_SIZE options from the MFS implementation.

Add MD_ROOT and MD_ROOT_SIZE options to the md driver.

Make the md driver handle MFS_ROOT and MFS_ROOT_SIZE options for compatibility.

Add md driver to GENERIC, PCCARD and LINT.

This is a cleanup which removes the need for some of the worse hacks in
MFS:  We really want to have a rootvnode but MFS on a preloaded image
doesn't really have one.  md is a true device, so it is less trouble.

This has been tested with make release, and if people remember to add
the "md" pseudo-device to their kernels, PicoBSD should be just fine
as well.  If people have no other use for MFS, it can be removed from
the kernel.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Nov 20 22:43:27 1999 UTC (12 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +128 -68 lines
Teach the md driver to use preloaded files of type "md_image".

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Oct 11 19:15:15 1999 UTC (12 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +1 -2 lines
remove unused #include

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Sep 25 18:23:52 1999 UTC (12 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +1 -6 lines
Remove five now unused fields from struct cdevsw.  They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed Sep 22 21:23:21 1999 UTC (12 years, 4 months ago) by green
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +6 -17 lines
Fix includes (remove unnecessary ones, reorder necessary ones.)
Also, correct an %x to be %lx.

Reviewed by:	phk

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Sep 21 12:05:38 1999 UTC (12 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +11 -7 lines
fix a buglet which jordan made me provoke :-)

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Sep 21 11:00:49 1999 UTC (12 years, 4 months ago) by phk
Branches: MAIN
Add an experimental Memory-Disk driver.  This driver will allocate
memory with malloc(9) using a few tricks to save space on the way.

Diff request

This form allows you to request diffs 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.

Log view options