summaryrefslogtreecommitdiffstats
path: root/sys/fs/specfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-01-04 22:10:36 +0000
committerphk <phk@FreeBSD.org>2003-01-04 22:10:36 +0000
commit131885aa2f8d42ce9c721f66cd0c84ec7789ffc0 (patch)
treec7a5f4c248cdb6b6c66f82139acb14ed7ec6d6d0 /sys/fs/specfs
parenta307536f906cea2e4ba4d10d51b320520f1a30c1 (diff)
downloadFreeBSD-src-131885aa2f8d42ce9c721f66cd0c84ec7789ffc0.zip
FreeBSD-src-131885aa2f8d42ce9c721f66cd0c84ec7789ffc0.tar.gz
Temporarily introduce a new VOP_SPECSTRATEGY operation while I try
to sort out disk-io from file-io in the vm/buffer/filesystem space. The intent is to sort VOP_STRATEGY calls into those which operate on "real" vnodes and those which operate on VCHR vnodes. For the latter kind, the call will be changed to VOP_SPECSTRATEGY, possibly conditionally for those places where dual-use happens. Add a default VOP_SPECSTRATEGY method which will call the normal VOP_STRATEGY. First time it is called it will print debugging information. This will only happen if a normal vnode is passed to VOP_SPECSTRATEGY by mistake. Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY does on a VCHR vnode today. Add a new VOP_STRATEGY method in specfs to catch instances where the conversion to VOP_SPECSTRATEGY has not yet happened. Handle the request just like we always did, but first time called print debugging information. Apart up to two instances of console messages per boot, this amounts to a glorified no-op commit. If you get any of the messages on your console I would very much like a copy of them mailed to phk@freebsd.org
Diffstat (limited to 'sys/fs/specfs')
-rw-r--r--sys/fs/specfs/spec_vnops.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c
index 61b4732..e0274bf 100644
--- a/sys/fs/specfs/spec_vnops.c
+++ b/sys/fs/specfs/spec_vnops.c
@@ -56,7 +56,6 @@
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
-
static int spec_advlock(struct vop_advlock_args *);
static int spec_close(struct vop_close_args *);
static int spec_freeblks(struct vop_freeblks_args *);
@@ -69,6 +68,8 @@ static int spec_poll(struct vop_poll_args *);
static int spec_print(struct vop_print_args *);
static int spec_read(struct vop_read_args *);
static int spec_strategy(struct vop_strategy_args *);
+static int spec_xstrategy(struct vop_strategy_args *);
+static int spec_specstrategy(struct vop_specstrategy_args *);
static int spec_write(struct vop_write_args *);
vop_t **spec_vnodeop_p;
@@ -104,6 +105,7 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
{ &vop_rename_desc, (vop_t *) vop_panic },
{ &vop_rmdir_desc, (vop_t *) vop_panic },
{ &vop_setattr_desc, (vop_t *) vop_ebadf },
+ { &vop_specstrategy_desc, (vop_t *) spec_specstrategy },
{ &vop_strategy_desc, (vop_t *) spec_strategy },
{ &vop_symlink_desc, (vop_t *) vop_panic },
{ &vop_unlock_desc, (vop_t *) vop_nounlock },
@@ -522,7 +524,7 @@ SYSCTL_INT(_debug, OID_AUTO, doslowdown, CTLFLAG_RW, &doslowdown, 0, "");
* Just call the device strategy routine
*/
static int
-spec_strategy(ap)
+spec_xstrategy(ap)
struct vop_strategy_args /* {
struct vnode *a_vp;
struct buf *a_bp;
@@ -609,6 +611,41 @@ spec_strategy(ap)
return (0);
}
+/*
+ * Decoy strategy routine. We should always come in via the specstrategy
+ * method, but in case some code has botched it, we have a strategy as
+ * well. We will deal with the request anyway and first time around we
+ * print some debugging useful information.
+ */
+
+static int
+spec_strategy(ap)
+ struct vop_strategy_args /* {
+ struct vnode *a_vp;
+ struct buf *a_bp;
+ } */ *ap;
+{
+ static int once;
+
+ if (!once) {
+ vprint("\nVOP_STRATEGY on VCHR\n", ap->a_vp);
+ backtrace();
+ once++;
+ }
+ return spec_xstrategy(ap);
+}
+
+static int
+spec_specstrategy(ap)
+ struct vop_specstrategy_args /* {
+ struct vnode *a_vp;
+ struct buf *a_bp;
+ } */ *ap;
+{
+
+ return spec_xstrategy((void *)ap);
+}
+
static int
spec_freeblks(ap)
struct vop_freeblks_args /* {
OpenPOWER on IntegriCloud