Commit Graph

50138 Commits

Author SHA1 Message Date
Poul-Henning Kamp
c108bb741c Remove VOP_SPECSTRATEGY() from the system. 2004-10-29 10:59:28 +00:00
Poul-Henning Kamp
0cbda9dfd5 Remove the last call in the system to VOP_SPECSTRATEGY(): We can no
longer come through the VNODE layer to the disks since all the filesystems
now go via geom_vfs to GEOM.
2004-10-29 10:52:31 +00:00
Poul-Henning Kamp
5cdfa40c6b Move NTFS to GEOM backing instead of DEVFS.
For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
2004-10-29 10:43:45 +00:00
Poul-Henning Kamp
a96d2ea768 Move HPFS to GEOM backing instead of DEVFS.
For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
2004-10-29 10:43:07 +00:00
Poul-Henning Kamp
48b67bb7fd Move EXT2FS to GEOM backing instead of DEVFS.
For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
2004-10-29 10:42:30 +00:00
Poul-Henning Kamp
bf7e2ae1c4 Move CD9660 to GEOM backing instead of DEVFS.
For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
2004-10-29 10:41:44 +00:00
Poul-Henning Kamp
429c018a9f Move UDF to GEOM backing instead of DEVFS.
For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
2004-10-29 10:40:58 +00:00
Poul-Henning Kamp
9a135592e2 Move MSDOSFS to GEOM backing instead of DEVFS.
For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
2004-10-29 10:40:14 +00:00
Poul-Henning Kamp
4392001125 Move UFS from DEVFS backing to GEOM backing.
This eliminates a bunch of vnode overhead (approx 1-2 % speed
improvement) and gives us more control over the access to the storage
device.

Access counts on the underlying device are not correctly tracked and
therefore it is possible to read-only mount the same disk device multiple
times:
	syv# mount -p
	/dev/md0        /var    ufs rw  2 2
	/dev/ad0        /mnt    ufs ro  1 1
	/dev/ad0        /mnt2   ufs ro  1 1
	/dev/ad0        /mnt3   ufs ro  1 1

Since UFS/FFS is not a synchrousely consistent filesystem (ie: it caches
things in RAM) this is not possible with read-write mounts, and the system
will correctly reject this.

Details:

	Add a geom consumer and a bufobj pointer to ufsmount.

	Eliminate the vnode argument from softdep_disk_prewrite().
	Pick the vnode out of bp->b_vp for now.  Eventually we
	should find it through bp->b_bufobj->b_private.

	In the mountcode, use g_vfs_open() once we have used
	VOP_ACCESS() to check permissions.

	When upgrading and downgrading between r/o and r/w do the
	right thing with GEOM access counts.  Remove all the
	workarounds for not being able to do this with VOP_OPEN().

	If we are the root mount, drop the exclusive access count
	until we upgrade to r/w.  This allows fsck of the root
	filesystem and the MNT_RELOAD to work correctly.

	Set bo_private to the GEOM consumer on the device bufobj.

	Change the ffs_ops->strategy function to call g_vfs_strategy()

	In ufs_strategy() directly call the strategy on the disk
	bufobj.  Same in rawread.

	In ffs_fsync() we will no longer see VCHR device nodes, so
	remove code which synced the filesystem mounted on it, in
	case we came there.  I'm not sure this code made sense in
	the first place since we would have taken the specfs route
	on such a vnode.

	Redo the highly bogus readblock() function in the snapshot
	code to something slightly less bogus: Constructing an uio
	and using physio was really quite a detour.  Instead just
	fill in a bio and ship it down.
2004-10-29 10:15:56 +00:00
Poul-Henning Kamp
4d13ab3da2 Add GEOM class "VFS" for filesystems and other buffer cache users
of GEOM devices.

There is nothing magic about this, it just gives a bufobj interface
to GEOM.
2004-10-29 09:56:56 +00:00
Poul-Henning Kamp
e1f355fe4e Give the bufobj a private __bo_vnode for now to keep the syncer floating [1]
At some point later the syncer will unlearn about vnodes and the filesystems
method called by the syncer will know enough about what's in bo_private to
do the right thing.

[1] Ok, I know, but I couldn't resist the pun.
2004-10-29 09:33:32 +00:00
Poul-Henning Kamp
725419af56 Add g_wither_geom_close() function. 2004-10-29 09:19:03 +00:00
Alfred Perlstein
cd71c41476 Backout 1.291.
re doesn't seem to think this fixes:
  Desired features for 5.3-RELEASE "More truss problems"
2004-10-29 08:24:41 +00:00
Poul-Henning Kamp
6afb3b1c37 Give dev_strategy() an explict cdev argument in preparation for removing
buf->b-dev.

Put a bio between the buf passed to dev_strategy() and the device driver
strategy routine in order to not clobber fields in the buf.

Assert copyright on vfs_bio.c and update copyright message to canonical
text.  There is no legal difference between John Dysons two-clause
abbreviated BSD license and the canonical text.
2004-10-29 07:16:37 +00:00
John Baldwin
b7001e08ba Handle all types of interrupts when operating the uhci(4) controller in
polled mode.

PR:		kern/73000
Submitted by:	Daan Vreeken <Danovitsch at Vitsch dot net>
MFC after:	1 month
2004-10-28 20:24:50 +00:00
Gleb Smirnoff
f2b9562c53 Rename debug macro to DBG and indent it properly.
Requested by:	maxim
Approved by:	julian (mentor)
2004-10-28 18:23:44 +00:00
Hidetoshi Shimokawa
520d7d186b Use dcons buffer passed by loader on amd64. 2004-10-28 12:18:22 +00:00
Hidetoshi Shimokawa
1107015620 MFi386: preserve dcons buffer passed by loader. 2004-10-28 12:16:03 +00:00
SUZUKI Shinsuke
b3fe9bc483 fixed a bug that incorrect IPsec request level may be returned for proto AH
Obtained from: KAME
2004-10-28 09:24:45 +00:00
Poul-Henning Kamp
c5995e45eb Lock bp->b_bufobj->b_object instead of bp->b_object 2004-10-28 08:38:46 +00:00
Poul-Henning Kamp
f00f5d71c2 Reduce the locking activity by epsilon by checking VNON condition before
releasing the mountlock.
2004-10-28 08:22:11 +00:00
Poul-Henning Kamp
570a7ddaa3 We only support backing UFS/FFS with disks. 2004-10-28 06:19:28 +00:00
Poul-Henning Kamp
45628dd373 What can I say: don't allow people to mount DEVFS with option "nodev". 2004-10-28 06:03:25 +00:00
Alan Cox
f4d49654ae Assert that the containing vm object is locked in vm_page_cache() and
vm_page_try_to_cache().
2004-10-28 05:26:21 +00:00
Alfred Perlstein
4ebbd9b988 comment out debug printf.
Submitted by: rees
2004-10-27 23:19:34 +00:00
Bosko Milekic
a5a262c6db Fix a INVARIANTS-only bug introduced in Revision 1.104:
IF INVARIANTS is defined, and in the rare case that we have
allocated some objects from the slab and at least one initializer
on at least one of those objects failed, and we need to fail the
allocation and push the uninitialized items back into the slab
caches -- in that scenario, we would fail to [re]set the
bucket cache's ub_bucket item references to NULL, which would
eventually trigger a KASSERT.
2004-10-27 21:19:35 +00:00
Robert Watson
df970488b3 Move the 'debug' sysctl tree under options SYSCTL_DEBUG. It generates
an inordinate amount of synchronous console output that is fairly
undesirable on slower serial console.  It's easily hit by accident
when frobbing other sysctls late at night.
2004-10-27 19:26:01 +00:00
Bruce M Simpson
d6dd4af4ac Forcibly disable interrupts, if we find ourselves servicing one when
the device is suspended or shutting down. This will need to be rethought
slightly if we implement suspend/resume support within vr(4).
This appears to fix the vr_shutdown() panic on SMP machines.

My theory here is there's a race somewhere during vr_detach() with
vr_intr() in the SMP case which was sometimes being triggered,
although quite why this was happening is unclear (vr_stop() also
explicitly disables interrupts by writing to the IMR register).

MFC-to-RELENG_5* candidate.

PR:		kern/62889
Tested by:	seb at struchtrup dot com
MFC after:	10 days
2004-10-27 19:02:23 +00:00
Alan Cox
b08abf6cc0 During traversal of the active queue, try locking the page's containing
object before accessing the page's flags or the object's reference count.
If the trylock fails, handle the page as though it is busy.
2004-10-27 18:29:17 +00:00
Peter Wemm
3904b13fab Raise MAXDSIZ from 8G to 32G. The old limit was just an arbitary choice
that was greater than 4G.  I originally used the same values as i386 in
order to save opening a new PML4 page slot, but in the day of gigabytes
of memory, worrying about a 4K page seems futile.  Moving from 8 to 32G
moves the page to a different index, it doesn't increase the number of
pages used.
2004-10-27 17:21:15 +00:00
Poul-Henning Kamp
20eba72f53 Move the syncer linkage from vnode to bufobj.
This is not quite a perfect separation: the syncer still think it knows
that everything is a vnode.
2004-10-27 08:05:02 +00:00
Poul-Henning Kamp
d83b7498a4 Eliminate unnecessary KASSERTs.
Don't use bp->b_vp in VOP_STRATEGY: the vnode is passed in as an argument.
2004-10-27 06:48:21 +00:00
Poul-Henning Kamp
5b285effb0 Eliminate unnecessary KASSERT.
Eliminate a printf which would never tell us anything anyway because the
KASSERT would have triggered.
2004-10-27 06:47:00 +00:00
Poul-Henning Kamp
f6b855f60b Avoid using bp->b_vp when we already have the vnode by other means. 2004-10-27 06:45:52 +00:00
Poul-Henning Kamp
a40a512387 Eliminate unnecessary KASSERTS. 2004-10-27 06:45:06 +00:00
Maxim Konovalov
2899faf96b Fix a typo in a comparison appeared in rev. 1.125.
Submitted by:	JINMEI Tatuya
2004-10-27 05:37:58 +00:00
Alan Cox
df9f17c3df Synchronize access to the vm page's PG_BUSY flag using the containing vm
object's lock.  In the same place, eliminate unnecessary checks for a NULL
vm object pointer.
2004-10-27 02:05:00 +00:00
Lukas Ertl
6c39d46363 Give each plex a separate queue where held back bios are put on.
This lowers the CPU usage of the worker thread and prevents a
possible live lock on non-SMP machines.

MFC candidate.
2004-10-26 21:01:42 +00:00
Poul-Henning Kamp
93d244fb1a KASSERT that we only get to prewrite() on writes. 2004-10-26 20:13:49 +00:00
Poul-Henning Kamp
8dd5650594 White space changes. Add missing static. 2004-10-26 20:13:21 +00:00
Poul-Henning Kamp
53389dd64a Replace single case switch() with if(). 2004-10-26 20:12:25 +00:00
Poul-Henning Kamp
b6e2606155 Vertically align comment. 2004-10-26 20:12:00 +00:00
Poul-Henning Kamp
882e79f620 Remove blank line which crept in. 2004-10-26 20:11:27 +00:00
Poul-Henning Kamp
6229cc508b Also check that the sectormask is bigger than zero.
Wrap this overly long KASSERT and remove newline.
2004-10-26 19:51:57 +00:00
Bruce M Simpson
4cc36d8a8b Workaround for a recursive acquisition of the driver mutex during device
detach; triggered by ether_ifdetach() -> if_delmulti() -> vr_ioctl().
MFC candidate.

PR:		kern/62889
MFC after:	3 days
2004-10-26 19:49:45 +00:00
Dag-Erling Smørgrav
995356dc10 Uncomment DIRECTIO and NSWBUF_MIN. They are both positive options (i.e.
they enable rather than disable code), so they should be on in LINT.
2004-10-26 12:20:57 +00:00
Poul-Henning Kamp
6e77a04170 The island council met and voted buf_prewrite() home.
Give ffs it's own bufobj->bo_ops vector and create a private strategy
routine, (currently misnamed for forwards compatibility), which is
just a copy of the generic bufstrategy routine except we call
softdep_disk_prewrite() directly instead of through the buf_prewrite()
indirection.

Teach UFS about the need for softdep_disk_prewrite() and call the
function directly in FFS.

Remove buf_prewrite() from the default bufstrategy() and from the
global bio_ops method vector.
2004-10-26 10:44:10 +00:00
Poul-Henning Kamp
58883a1fe5 Fix syntax errors introduced by last commit.
Why isn't DIRECTIO in NOTES/LINT ?
2004-10-26 09:04:20 +00:00
Robert Watson
c427483381 Add a matching tunable for net.inet.tcp.sack.enable sysctl. 2004-10-26 08:59:09 +00:00
Poul-Henning Kamp
5d9d81e7ea Put the I/O block size in bufobj->bo_bsize.
We keep si_bsize_phys around for now as that is the simplest way to pull
the number out of disk device drivers in devfs_open().  The correct solution
would be to do an ioctl(DIOCGSECTORSIZE), but the point is probably mooth
when filesystems sit on GEOM, so don't bother for now.
2004-10-26 07:39:12 +00:00