From owner-svn-src-all@FreeBSD.ORG Wed May 4 18:41:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E5E5106566B; Wed, 4 May 2011 18:41:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5B58FC15; Wed, 4 May 2011 18:41:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p44IfQwx062713; Wed, 4 May 2011 18:41:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p44IfQmM062711; Wed, 4 May 2011 18:41:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105041841.p44IfQmM062711@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 4 May 2011 18:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221453 - head/sys/geom/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 18:41:26 -0000 Author: ae Date: Wed May 4 18:41:26 2011 New Revision: 221453 URL: http://svn.freebsd.org/changeset/base/221453 Log: Remove unneeded code. MFC after: 1 week Modified: head/sys/geom/sched/g_sched.c Modified: head/sys/geom/sched/g_sched.c ============================================================================== --- head/sys/geom/sched/g_sched.c Wed May 4 18:26:45 2011 (r221452) +++ head/sys/geom/sched/g_sched.c Wed May 4 18:41:26 2011 (r221453) @@ -1004,11 +1004,6 @@ g_sched_create(struct gctl_req *req, str gp = g_new_geomf(mp, name); dstgp = proxy ? pp->geom : gp; /* where do we link the provider */ - if (gp == NULL) { - gctl_error(req, "Cannot create geom %s.", name); - error = ENOMEM; - goto fail; - } sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); sc->sc_gsched = gsp; @@ -1034,23 +1029,10 @@ g_sched_create(struct gctl_req *req, str gp->dumpconf = g_sched_dumpconf; newpp = g_new_providerf(dstgp, gp->name); - if (newpp == NULL) { - gctl_error(req, "Cannot create provider %s.", name); - error = ENOMEM; - goto fail; - } - newpp->mediasize = pp->mediasize; newpp->sectorsize = pp->sectorsize; cp = g_new_consumer(gp); - if (cp == NULL) { - gctl_error(req, "Cannot create consumer for %s.", - gp->name); - error = ENOMEM; - goto fail; - } - error = g_attach(cp, proxy ? newpp : pp); if (error != 0) { gctl_error(req, "Cannot attach to provider %s.", @@ -1076,23 +1058,15 @@ fail: g_detach(cp); g_destroy_consumer(cp); } - if (newpp != NULL) g_destroy_provider(newpp); - - if (sc && sc->sc_hash) { + if (sc->sc_hash) g_sched_hash_fini(gp, sc->sc_hash, sc->sc_mask, gsp, sc->sc_data); - } - - if (sc && sc->sc_data) + if (sc->sc_data) gsp->gs_fini(sc->sc_data); - - if (gp != NULL) { - if (gp->softc != NULL) - g_free(gp->softc); - g_destroy_geom(gp); - } + g_free(gp->softc); + g_destroy_geom(gp); return (error); }