From owner-svn-src-all@FreeBSD.ORG Tue Apr 26 07:35:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE4F106566C; Tue, 26 Apr 2011 07:35:37 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 643138FC15; Tue, 26 Apr 2011 07:35:36 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 5C1FE45E87; Tue, 26 Apr 2011 09:35:34 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 255E545685; Tue, 26 Apr 2011 09:35:28 +0200 (CEST) Date: Tue, 26 Apr 2011 09:35:17 +0200 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20110426073517.GF2472@garage.freebsd.pl> References: <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="65ImJOski3p8EhYV" Content-Disposition: inline In-Reply-To: <4DB6721B.3020600@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 07:35:37 -0000 --65ImJOski3p8EhYV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 10:19:55AM +0300, Alexander Motin wrote: > On 26.04.2011 10:00, Pawel Jakub Dawidek wrote: > >On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote: > >>I've thought about the process of fixing hardcoded provider names there, > >>and it is absolutely not trivial. If we take the "symlinking" way (patch > >>is already posted to current@), I think it will be much easier for > >>everybody, and especially users, if I hack all mentioned above GEOM > >>classes to ignore adX/adaY difference in provider names. And it should > >>perfectly fit into remaining time window. > > > >Could you be more specific what the hack would do exactly? >=20 > I would write some comparison function, which would search both > names for adX/adaY prefixes, if they found on both arguments, > trimmed them and compared remaining parts. >=20 > I think for usual purpose of name hardcoding device name part is > less important. Comparing partition names part should be enough. The > tricky part there is to properly identify device part, so I was > thinking about specific hack for adX/adaY. I was wondering how would you match X and Y, but this is indeed not important. So on taste we could do (totally untested): static bool provider_name_matches(const char *ppname, const char *hcname) { if (strcmp(ppname, hcname) =3D=3D 0) return (true); if (strncmp(hcname, "ad", 2) !=3D 0 || hcname[2] < '0' || hcname[2] > '9') { return (false); } if (strncmp(ppname, "ada", 3) !=3D 0 || ppname[3] < '0' || ppname[3] > '9') { return (false); } /* Skip 'ad[0-9]+'. */ hcname +=3D 3; while (hcname[0] >=3D '0' && hcname[0] <=3D '9') hcname++; /* Skip 'ada[0-9]+'. ppname +=3D 4; while (ppname[0] >=3D '0' && ppname[0] <=3D '9') ppname++; return (strcmp(ppname, hcname) =3D=3D 0); } That could work. Another possibility I was thinking of was to create GEOM providers for both names and orphan the other name once one of them is opened for writing. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --65ImJOski3p8EhYV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk22dbUACgkQForvXbEpPzQbigCeNwDcYVHDWMG/NqzX+qOsTWXz 78cAnjuTBx9e7BEOTy/1NohoWyeiBGs1 =jhHX -----END PGP SIGNATURE----- --65ImJOski3p8EhYV--