From owner-freebsd-geom@FreeBSD.ORG Thu Aug 18 06:16:45 2011 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C66E106566C; Thu, 18 Aug 2011 06:16:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail.kirov.so-ups.ru (ns.kirov.so-ups.ru [178.74.170.1]) by mx1.freebsd.org (Postfix) with ESMTP id D2B268FC17; Thu, 18 Aug 2011 06:16:44 +0000 (UTC) Received: from kas30pipe.localhost (localhost.kirov.so-cdu.ru [127.0.0.1]) by mail.kirov.so-ups.ru (Postfix) with SMTP id 14DCCB8027; Thu, 18 Aug 2011 09:58:08 +0400 (MSD) Received: from kirov.so-cdu.ru (unknown [172.21.81.1]) by mail.kirov.so-ups.ru (Postfix) with ESMTP id 0A2ABB8008; Thu, 18 Aug 2011 09:58:08 +0400 (MSD) Received: by ns.kirov.so-cdu.ru (Postfix, from userid 1010) id D8CCBB8EDB; Thu, 18 Aug 2011 09:58:07 +0400 (MSD) Received: from [10.118.3.52] (elsukov.kirov.oduur.so [10.118.3.52]) by ns.kirov.so-cdu.ru (Postfix) with ESMTP id A2152B8E63; Thu, 18 Aug 2011 09:58:07 +0400 (MSD) Message-ID: <4E4CA9EF.8030201@FreeBSD.org> Date: Thu, 18 Aug 2011 09:58:07 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Nathan Whitehorn References: <4DB54F40.8050608@FreeBSD.org> <4DB7C7B7.9020201@FreeBSD.org> <4DBAED76.3030006@FreeBSD.org> <4E4C5813.2060104@freebsd.org> In-Reply-To: <4E4C5813.2060104@freebsd.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release X-SpamTest-Info: Not protected Cc: Marcel Moolenaar , Pawel Jakub Dawidek , freebsd-geom@FreeBSD.org, Alexander Motin , Andriy Gapon , FreeBSD Current Subject: Re: A replacement for GEOM_LABEL's gpt/gptid X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2011 06:16:45 -0000 On 18.08.2011 4:08, Nathan Whitehorn wrote: >> What it contains: >> * gpt/gptid support removed from GEOM_LABEL class; >> * new GEOM_ALIAS class added. This class has two public functions: >> void g_alias_create(struct g_provider *pp, const char *name); >> void g_alias_spoil(struct g_provider *pp); >> * first two consumers of GEOM_ALIAS class are GEOM_PART and GEOM_DISK: >> >> GEOM_DISK uses g_alias_create() to create aliases for disks, disk's >> serial number is used for alias name. >> >> GEOM_PART uses g_alias_create() to create aliases for labeled partitions >> (gpt/gptid, apm and pc98). >> >> How it looks like: >> http://paste.org.ru/?5exeve >> > > What happened to this? It would be really nice to have in 9.0, or soon after anyway. Anything I can > do to help it along? :) Well, there were some problems found. AFAIR, the last patch i tested is here: http://people.freebsd.org/~ae/geom_alias.diff Among other things it slightly extends GEOM core to be able pass trough taste and spoil events. To recall for myself how it works: I added new GEOM class - GEOM_ALIAS. It provides two public functions: void g_alias_create(struct g_provider *pp, const char *name); It creates one instance of geom_alias class for given provider and this instance might have several providers (aliases). void g_alias_spoil(struct g_provider *pp); It destroys all aliases for given provider if they are not in use. If some alias is used, then function only marks it as stale. The access method of GEOM_ALIAS class destroys stale provider when it is released. The spoiled method calls g_spoil() for each alias, i.e. it passes spoil event to consumers of all aliases. The taste method checks given provider and if it has GEOM_ALIAS consumer and it was spoiled before, then it does "retaste" for each alias. I don't remember what were the results of testing, but looks like there is something that could be improved. -- WBR, Andrey V. Elsukov