Deleted Added
sdiff udiff text old ( 279324 ) new ( 280687 )
full compact
1/*-
2 * Copyright (c) 2007, 2008 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sbin/geom/class/part/geom_part.c 279324 2015-02-26 15:59:45Z ae $");
29
30#include <sys/stat.h>
31#include <sys/vtoc.h>
32
33#include <assert.h>
34#include <ctype.h>
35#include <err.h>
36#include <errno.h>

--- 165 unchanged lines hidden (view full) ---

202 return (classp);
203 }
204 return (NULL);
205}
206
207static struct ggeom *
208find_geom(struct gclass *classp, const char *name)
209{
210 struct ggeom *gp;
211
212 if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
213 name += sizeof(_PATH_DEV) - 1;
214 LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {
215 if (strcmp(gp->lg_name, name) == 0)
216 return (gp);
217 }
218 return (NULL);
219}
220
221static const char *
222find_geomcfg(struct ggeom *gp, const char *cfg)
223{
224 struct gconfig *gc;
225
226 LIST_FOREACH(gc, &gp->lg_config, lg_config) {

--- 377 unchanged lines hidden (view full) ---

604gpart_show_geom(struct ggeom *gp, const char *element, int show_providers)
605{
606 struct gprovider *pp;
607 const char *s, *scheme;
608 off_t first, last, sector, end;
609 off_t length, secsz;
610 int idx, wblocks, wname, wmax;
611
612 scheme = find_geomcfg(gp, "scheme");
613 if (scheme == NULL)
614 errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name);
615 s = find_geomcfg(gp, "first");
616 if (s == NULL)
617 errx(EXIT_FAILURE, "Starting block not found for geom %s",
618 gp->lg_name);
619 first = (off_t)strtoimax(s, NULL, 0);

--- 701 unchanged lines hidden ---