Deleted Added
full compact
g_part.c (256690) g_part.c (256880)
1/*-
2 * Copyright (c) 2002, 2005-2009 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 *

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002, 2005-2009 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 *

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/geom/part/g_part.c 256690 2013-10-17 16:18:43Z ae $");
28__FBSDID("$FreeBSD: head/sys/geom/part/g_part.c 256880 2013-10-22 08:22:19Z mav $");
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/endian.h>
33#include <sys/kernel.h>
34#include <sys/kobj.h>
35#include <sys/limits.h>
36#include <sys/lock.h>

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

413 entry->gpe_offset = offset;
414
415 if (entry->gpe_pp == NULL) {
416 sb = sbuf_new_auto();
417 G_PART_FULLNAME(table, entry, sb, gp->name);
418 sbuf_finish(sb);
419 entry->gpe_pp = g_new_providerf(gp, "%s", sbuf_data(sb));
420 sbuf_delete(sb);
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/endian.h>
33#include <sys/kernel.h>
34#include <sys/kobj.h>
35#include <sys/limits.h>
36#include <sys/lock.h>

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

413 entry->gpe_offset = offset;
414
415 if (entry->gpe_pp == NULL) {
416 sb = sbuf_new_auto();
417 G_PART_FULLNAME(table, entry, sb, gp->name);
418 sbuf_finish(sb);
419 entry->gpe_pp = g_new_providerf(gp, "%s", sbuf_data(sb));
420 sbuf_delete(sb);
421 entry->gpe_pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE;
421 entry->gpe_pp->private = entry; /* Close the circle. */
422 }
423 entry->gpe_pp->index = entry->gpe_index - 1; /* index is 1-based. */
424 entry->gpe_pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) *
425 pp->sectorsize;
426 entry->gpe_pp->mediasize -= entry->gpe_offset - offset;
427 entry->gpe_pp->sectorsize = pp->sectorsize;
428 entry->gpe_pp->stripesize = pp->stripesize;

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

925 table = gp->softc;
926 table->gpt_gp = gp;
927 table->gpt_scheme = gpp->gpp_scheme;
928 table->gpt_entries = (gpp->gpp_parms & G_PART_PARM_ENTRIES) ?
929 gpp->gpp_entries : scheme->gps_minent;
930 LIST_INIT(&table->gpt_entry);
931 if (null == NULL) {
932 cp = g_new_consumer(gp);
422 entry->gpe_pp->private = entry; /* Close the circle. */
423 }
424 entry->gpe_pp->index = entry->gpe_index - 1; /* index is 1-based. */
425 entry->gpe_pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) *
426 pp->sectorsize;
427 entry->gpe_pp->mediasize -= entry->gpe_offset - offset;
428 entry->gpe_pp->sectorsize = pp->sectorsize;
429 entry->gpe_pp->stripesize = pp->stripesize;

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

926 table = gp->softc;
927 table->gpt_gp = gp;
928 table->gpt_scheme = gpp->gpp_scheme;
929 table->gpt_entries = (gpp->gpp_parms & G_PART_PARM_ENTRIES) ?
930 gpp->gpp_entries : scheme->gps_minent;
931 LIST_INIT(&table->gpt_entry);
932 if (null == NULL) {
933 cp = g_new_consumer(gp);
934 cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
933 error = g_attach(cp, pp);
934 if (error == 0)
935 error = g_access(cp, 1, 1, 1);
936 if (error != 0) {
937 g_part_wither(gp, error);
938 gctl_error(req, "%d geom '%s'", error, pp->name);
939 return (error);
940 }

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

1881
1882 /*
1883 * Create a GEOM with consumer and hook it up to the provider.
1884 * With that we become part of the topology. Optain read access
1885 * to the provider.
1886 */
1887 gp = g_new_geomf(mp, "%s", pp->name);
1888 cp = g_new_consumer(gp);
935 error = g_attach(cp, pp);
936 if (error == 0)
937 error = g_access(cp, 1, 1, 1);
938 if (error != 0) {
939 g_part_wither(gp, error);
940 gctl_error(req, "%d geom '%s'", error, pp->name);
941 return (error);
942 }

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

1883
1884 /*
1885 * Create a GEOM with consumer and hook it up to the provider.
1886 * With that we become part of the topology. Optain read access
1887 * to the provider.
1888 */
1889 gp = g_new_geomf(mp, "%s", pp->name);
1890 cp = g_new_consumer(gp);
1891 cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
1889 error = g_attach(cp, pp);
1890 if (error == 0)
1891 error = g_access(cp, 1, 0, 0);
1892 if (error != 0) {
1893 if (cp->provider)
1894 g_detach(cp);
1895 g_destroy_consumer(cp);
1896 g_destroy_geom(gp);

--- 399 unchanged lines hidden ---
1892 error = g_attach(cp, pp);
1893 if (error == 0)
1894 error = g_access(cp, 1, 0, 0);
1895 if (error != 0) {
1896 if (cp->provider)
1897 g_detach(cp);
1898 g_destroy_consumer(cp);
1899 g_destroy_geom(gp);

--- 399 unchanged lines hidden ---