ccdconfig.c (d414fcbc3e9954ae61735b9583406f74fc8f25fd) | ccdconfig.c (3f4f4a1465e1b9e6174d6bac813020768efd18b3) |
---|---|
1/* 2 * Copyright (c) 2003 Poul-Henning Kamp 3 * Copyright (c) 1995 Jason R. Thorpe. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 36 unchanged lines hidden (view full) --- 45#include <stdio.h> 46#include <stdlib.h> 47#include <string.h> 48#include <unistd.h> 49#include <libgeom.h> 50 51#define CCDF_UNIFORM 0x02 /* use LCCD of sizes for uniform interleave */ 52#define CCDF_MIRROR 0x04 /* use mirroring */ | 1/* 2 * Copyright (c) 2003 Poul-Henning Kamp 3 * Copyright (c) 1995 Jason R. Thorpe. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 36 unchanged lines hidden (view full) --- 45#include <stdio.h> 46#include <stdlib.h> 47#include <string.h> 48#include <unistd.h> 49#include <libgeom.h> 50 51#define CCDF_UNIFORM 0x02 /* use LCCD of sizes for uniform interleave */ 52#define CCDF_MIRROR 0x04 /* use mirroring */ |
53#define CCDF_NO_OFFSET 0x08 /* do not leave space in front */ 54#define CCDF_LINUX 0x10 /* use Linux compatibility mode */ |
|
53 54#include "pathnames.h" 55 56static int lineno = 0; 57static int verbose = 0; 58static const char *ccdconf = _PATH_CCDCONF; 59 60struct flagval { 61 const char *fv_flag; 62 int fv_val; 63} flagvaltab[] = { 64 { "CCDF_UNIFORM", CCDF_UNIFORM }, 65 { "uniform", CCDF_UNIFORM }, 66 { "CCDF_MIRROR", CCDF_MIRROR }, 67 { "mirror", CCDF_MIRROR }, | 55 56#include "pathnames.h" 57 58static int lineno = 0; 59static int verbose = 0; 60static const char *ccdconf = _PATH_CCDCONF; 61 62struct flagval { 63 const char *fv_flag; 64 int fv_val; 65} flagvaltab[] = { 66 { "CCDF_UNIFORM", CCDF_UNIFORM }, 67 { "uniform", CCDF_UNIFORM }, 68 { "CCDF_MIRROR", CCDF_MIRROR }, 69 { "mirror", CCDF_MIRROR }, |
70 { "CCDF_NO_OFFSET", CCDF_NO_OFFSET }, 71 { "no_offset", CCDF_NO_OFFSET }, 72 { "CCDF_LINUX", CCDF_LINUX }, 73 { "linux", CCDF_LINUX }, |
|
68 { "none", 0 }, 69 { NULL, 0 }, 70}; 71 72#define CCD_CONFIG 0 /* configure a device */ 73#define CCD_CONFIGALL 1 /* configure all devices */ 74#define CCD_UNCONFIG 2 /* unconfigure a device */ 75#define CCD_UNCONFIGALL 3 /* unconfigure all devices */ --- 164 unchanged lines hidden (view full) --- 240 gctl_ro_param(grq, "verb", -1, "create geom"); 241 gctl_ro_param(grq, "class", -1, "CCD"); 242 gctl_ro_param(grq, "unit", sizeof(ccd), &ccd); 243 gctl_ro_param(grq, "ileave", sizeof(ileave), &ileave); 244 if (flags & CCDF_UNIFORM) 245 gctl_ro_param(grq, "uniform", -1, ""); 246 if (flags & CCDF_MIRROR) 247 gctl_ro_param(grq, "mirror", -1, ""); | 74 { "none", 0 }, 75 { NULL, 0 }, 76}; 77 78#define CCD_CONFIG 0 /* configure a device */ 79#define CCD_CONFIGALL 1 /* configure all devices */ 80#define CCD_UNCONFIG 2 /* unconfigure a device */ 81#define CCD_UNCONFIGALL 3 /* unconfigure all devices */ --- 164 unchanged lines hidden (view full) --- 246 gctl_ro_param(grq, "verb", -1, "create geom"); 247 gctl_ro_param(grq, "class", -1, "CCD"); 248 gctl_ro_param(grq, "unit", sizeof(ccd), &ccd); 249 gctl_ro_param(grq, "ileave", sizeof(ileave), &ileave); 250 if (flags & CCDF_UNIFORM) 251 gctl_ro_param(grq, "uniform", -1, ""); 252 if (flags & CCDF_MIRROR) 253 gctl_ro_param(grq, "mirror", -1, ""); |
254 if (flags & CCDF_NO_OFFSET) 255 gctl_ro_param(grq, "no_offset", -1, ""); 256 if (flags & CCDF_LINUX) 257 gctl_ro_param(grq, "linux", -1, ""); |
|
248 gctl_ro_param(grq, "nprovider", sizeof(argc), &argc); 249 for (i = 0; i < argc; i++) { 250 sprintf(buf1, "provider%d", i); 251 cp = argv[i]; 252 if (!strncmp(cp, _PATH_DEV, strlen(_PATH_DEV))) 253 cp += strlen(_PATH_DEV); 254 gctl_ro_param(grq, buf1, -1, cp); 255 } --- 184 unchanged lines hidden --- | 258 gctl_ro_param(grq, "nprovider", sizeof(argc), &argc); 259 for (i = 0; i < argc; i++) { 260 sprintf(buf1, "provider%d", i); 261 cp = argv[i]; 262 if (!strncmp(cp, _PATH_DEV, strlen(_PATH_DEV))) 263 cp += strlen(_PATH_DEV); 264 gctl_ro_param(grq, buf1, -1, cp); 265 } --- 184 unchanged lines hidden --- |