From owner-freebsd-hackers Tue Jul 21 18:53:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA06995 for freebsd-hackers-outgoing; Tue, 21 Jul 1998 18:53:22 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from freebie.lemis.com (freebie.lemis.com [139.130.136.133] (may be forged)) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA06975 for ; Tue, 21 Jul 1998 18:53:03 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id LAA08898; Wed, 22 Jul 1998 11:22:41 +0930 (CST) Message-ID: <19980722112240.K8098@freebie.lemis.com> Date: Wed, 22 Jul 1998 11:22:40 +0930 From: Greg Lehey To: FreeBSD Hackers Subject: How do I access a block device in -CURRENT? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Since the change in bdevsw/cdevsw in -CURRENT, I have a problem: how do I access block devices from a driver? Previously I would do something like (*bdevsw [major (devno)]->d_strategy) (bp); I'm not supposed to use bdevsw any more, I should use cdevsw instead. But the major numbers are different. How do I find the correct major number? I went through the way the system does it, and found: #2 0xf014959e in spec_strategy (ap=0xf439de30) at ../../miscfs/specfs/spec_vnops.c:556 556 (*bdevsw[major(bp->b_dev)]->d_strategy)(bp); So what's the story now? Is bdevsw dead or not? How do I access the devices? One obvious choice would be to give block and character devices the same major numbers, like System V does, but the problems on changeover would be horrendous. Greg -- See complete headers for address and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message