Date: Sat, 24 Feb 2001 17:22:26 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Dima Dorfman <dima@unixfreak.org> Cc: Robert Watson <rwatson@freebsd.org>, freebsd-hackers@freebsd.org Subject: Re: Listing configured md(4) devices Message-ID: <8075.983031746@critter> In-Reply-To: Your message of "Thu, 22 Feb 2001 16:43:00 PST." <20010223004300.F09643E09@bazooka.unixfreak.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20010223004300.F09643E09@bazooka.unixfreak.org>, Dima Dorfman write s: >> 2) I'm not sure I like the strncmp(.., "md", 2) stuff, as that means that >> it would also match any other device name that might begin with md, which >> potentially might not be provided by the md driver. This is currently (I >> suspect) hypothetical as we don't have any other drivers beginning with >> md, but it would be nice not to preclude that in the future. Restricting >> all possible disk device names to two letters, of which the second is >> always d, is not a scalable approach. That said, writing an easy matching >> function without that assumption probably isn't all that easy, either. > >Assuming that a device name must consist of letters (which I suspect >is the case), it's fairly trivial; just check that what follows 'md' >is a number. > >Here's a patch against what I sent in previously to do that. The >original with this included can be found at >http://www.unixfreak.org/~dima/home/md-list3.diff. Hi Dima, This is great work. The "md" problem should really be solved by adding #define MD_NAME "md" to <sys/mdioctl.h> and using this in both the driver and the mdconfig program. Can I get you to incorporate that in your patch ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8075.983031746>