From owner-freebsd-fs@FreeBSD.ORG Fri Sep 4 01:12:26 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F884106566C; Fri, 4 Sep 2009 01:12:26 +0000 (UTC) (envelope-from mel.flynn+fbsd.fs@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 1C0328FC1B; Fri, 4 Sep 2009 01:12:25 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id B6CF47E853; Thu, 3 Sep 2009 17:12:35 -0800 (AKDT) From: Mel Flynn To: freebsd-fs@freebsd.org Date: Fri, 4 Sep 2009 03:12:20 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA3; KDE/4.2.4; i386; ; ) References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909031548.37887.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090903135741.GK1821@garage.freebsd.pl> In-Reply-To: <20090903135741.GK1821@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909040312.21376.mel.flynn+fbsd.fs@mailing.thruhere.net> Cc: Pawel Jakub Dawidek Subject: Re: Patch to allow gmirror to set priority of a disk X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2009 01:12:26 -0000 On Thursday 03 September 2009 15:57:41 Pawel Jakub Dawidek wrote: > On Thu, Sep 03, 2009 at 03:48:37PM +0200, Mel Flynn wrote: > > On Thursday 03 September 2009 14:44:07 Pawel Jakub Dawidek wrote: > > > I'd suggest doing this not as separate gmirror(8) subcommand, but as an > > > extension to 'configure' subcommand, where one can provide priority by > > > giving '-p' argument. > > > > Except I didn't see how configure was implemented. Am I correct that this > > is g_mirror_ctl_configure in sys/geom/mirror/g_mirror_ctl.c? > > Yes, you are correct. Quick question: how can I distinguish between "-p given" and "-p not given". All the configure commands work either on the mirror or all disks, for this I need to get the specific disk in a command line argument, but....as far as I can tell: priority = gctl_get_paraml(req, "priority", sizeof(*priority)); will give NULL, if userland and kernel are out of sync, as the geom should always fill the priority, as per: { 'p', "priority", NULL, G_TYPE_NUMBER }, Should I instead use: static int prio = -1; ... { 'p', "priority", &prio, G_TYPE_NUMBER }, And if the above returns -1, do_nada()? -- Mel