gvinum.c (190507) | gvinum.c (190881) |
---|---|
1/* 2 * Copyright (c) 2004 Lukas Ertl 3 * Copyright (c) 2005 Chris Jones 4 * Copyright (c) 2007 Ulf Lilleengen 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project 8 * by Chris Jones thanks to the support of Google's Summer of Code --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 2004 Lukas Ertl 3 * Copyright (c) 2005 Chris Jones 4 * Copyright (c) 2007 Ulf Lilleengen 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project 8 * by Chris Jones thanks to the support of Google's Summer of Code --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sbin/gvinum/gvinum.c 190507 2009-03-28 17:20:08Z lulf $ | 32 * $FreeBSD: head/sbin/gvinum/gvinum.c 190881 2009-04-10 08:50:14Z lulf $ |
33 */ 34 35#include <sys/param.h> 36#include <sys/linker.h> 37#include <sys/lock.h> 38#include <sys/module.h> 39#include <sys/mutex.h> 40#include <sys/queue.h> --- 387 unchanged lines hidden (view full) --- 428 429 drivename = find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME); 430 if (drivename == NULL) 431 return (NULL); 432 433 req = gctl_get_handle(); 434 gctl_ro_param(req, "class", -1, "VINUM"); 435 gctl_ro_param(req, "verb", -1, "create"); | 33 */ 34 35#include <sys/param.h> 36#include <sys/linker.h> 37#include <sys/lock.h> 38#include <sys/module.h> 39#include <sys/mutex.h> 40#include <sys/queue.h> --- 387 unchanged lines hidden (view full) --- 428 429 drivename = find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME); 430 if (drivename == NULL) 431 return (NULL); 432 433 req = gctl_get_handle(); 434 gctl_ro_param(req, "class", -1, "VINUM"); 435 gctl_ro_param(req, "verb", -1, "create"); |
436 d = malloc(sizeof(struct gv_drive)); | 436 d = gv_alloc_drive(); |
437 if (d == NULL) 438 err(1, "unable to allocate for gv_drive object"); | 437 if (d == NULL) 438 err(1, "unable to allocate for gv_drive object"); |
439 memset(d, 0, sizeof(struct gv_drive)); | |
440 441 strlcpy(d->name, drivename, sizeof(d->name)); 442 strlcpy(d->device, device, sizeof(d->device)); 443 gctl_ro_param(req, "drive0", sizeof(*d), d); 444 gctl_ro_param(req, "flags", sizeof(int), &flags); 445 gctl_ro_param(req, "drives", sizeof(int), &drives); 446 gctl_ro_param(req, "volumes", sizeof(int), &volumes); 447 gctl_ro_param(req, "plexes", sizeof(int), &plexes); --- 893 unchanged lines hidden --- | 439 440 strlcpy(d->name, drivename, sizeof(d->name)); 441 strlcpy(d->device, device, sizeof(d->device)); 442 gctl_ro_param(req, "drive0", sizeof(*d), d); 443 gctl_ro_param(req, "flags", sizeof(int), &flags); 444 gctl_ro_param(req, "drives", sizeof(int), &drives); 445 gctl_ro_param(req, "volumes", sizeof(int), &volumes); 446 gctl_ro_param(req, "plexes", sizeof(int), &plexes); --- 893 unchanged lines hidden --- |