Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 2009 03:12:20 +0200
From:      Mel Flynn <mel.flynn+fbsd.fs@mailing.thruhere.net>
To:        freebsd-fs@freebsd.org
Cc:        Pawel Jakub Dawidek <pjd@freebsd.org>
Subject:   Re: Patch to allow gmirror to set priority of a disk
Message-ID:  <200909040312.21376.mel.flynn%2Bfbsd.fs@mailing.thruhere.net>
In-Reply-To: <20090903135741.GK1821@garage.freebsd.pl>
References:  <200909030000.11961.mel.flynn%2Bfbsd.fs@mailing.thruhere.net> <200909031548.37887.mel.flynn%2Bfbsd.fs@mailing.thruhere.net> <20090903135741.GK1821@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909040312.21376.mel.flynn%2Bfbsd.fs>