Patch to allow gmirror to set priority of a disk

Mel Flynn mel.flynn+fbsd.fs at mailing.thruhere.net
Fri Sep 4 01:12:26 UTC 2009


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


More information about the freebsd-fs mailing list