1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
--- 18 unchanged lines hidden (view full) ---
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * $FreeBSD: head/sys/geom/geom_disk.c 110419 2003-02-05 21:13:08Z phk $
36 */
37
38#include "opt_geom.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>
43#include <sys/sysctl.h>
--- 105 unchanged lines hidden (view full) ---
149 di.mediasize = gkd->length;
150 error = set_dumper(&di);
151 g_io_deliver(bp, error);
152}
153
154static void
155g_disk_done(struct bio *bp)
156{
157 struct disk *dp;
158
159 dp = bp->bio_disk;
160 bp->bio_completed = bp->bio_length - bp->bio_resid;
161 if (!(dp->d_flags & DISKFLAG_NOGIANT)) {
162 DROP_GIANT();
163 g_std_done(bp);
164 PICKUP_GIANT();
165 } else {
166 g_std_done(bp);
167 }
168}
169
170static void
171g_disk_start(struct bio *bp)
172{
173 struct bio *bp2;
174 dev_t dev;
175 struct disk *dp;
--- 195 unchanged lines hidden ---
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
--- 18 unchanged lines hidden (view full) ---
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * $FreeBSD: head/sys/geom/geom_disk.c 110419 2003-02-05 21:13:08Z phk $
36 */
37
38#include "opt_geom.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>
43#include <sys/sysctl.h>
--- 105 unchanged lines hidden (view full) ---
149 di.mediasize = gkd->length;
150 error = set_dumper(&di);
151 g_io_deliver(bp, error);
152}
153
154static void
155g_disk_done(struct bio *bp)
156{
157 struct disk *dp;
158
159 dp = bp->bio_disk;
160 bp->bio_completed = bp->bio_length - bp->bio_resid;
161 if (!(dp->d_flags & DISKFLAG_NOGIANT)) {
162 DROP_GIANT();
163 g_std_done(bp);
164 PICKUP_GIANT();
165 } else {
166 g_std_done(bp);
167 }
168}
169
170static void
171g_disk_start(struct bio *bp)
172{
173 struct bio *bp2;
174 dev_t dev;
175 struct disk *dp;
--- 195 unchanged lines hidden ---