Deleted Added
full compact
fdc.c (47669) fdc.c (48225)
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)

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

42 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
43 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
45 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
46 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 * SUCH DAMAGE.
48 *
49 * from: @(#)fd.c 7.4 (Berkeley) 5/25/91
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)

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

42 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
43 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
45 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
46 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 * SUCH DAMAGE.
48 *
49 * from: @(#)fd.c 7.4 (Berkeley) 5/25/91
50 * $Id: fd.c,v 1.62 1999/05/30 16:53:16 phk Exp $
50 * $Id: fd.c,v 1.63 1999/06/01 13:14:34 kato Exp $
51 *
52 */
53
54#include "fd.h"
55#include "opt_devfs.h"
56#include "opt_fdc.h"
57
58#if NFDC > 0

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

2598 bp = (struct buf *)malloc(sizeof(struct buf), M_TEMP, M_NOWAIT);
2599 if(bp == 0)
2600 return ENOBUFS;
2601 /*
2602 * keep the process from being swapped
2603 */
2604 PHOLD(p);
2605 bzero((void *)bp, sizeof(struct buf));
51 *
52 */
53
54#include "fd.h"
55#include "opt_devfs.h"
56#include "opt_fdc.h"
57
58#if NFDC > 0

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

2598 bp = (struct buf *)malloc(sizeof(struct buf), M_TEMP, M_NOWAIT);
2599 if(bp == 0)
2600 return ENOBUFS;
2601 /*
2602 * keep the process from being swapped
2603 */
2604 PHOLD(p);
2605 bzero((void *)bp, sizeof(struct buf));
2606 bp->b_flags = B_BUSY | B_PHYS | B_FORMAT;
2606 BUF_INITLOCK(bp);
2607 BUF_LOCK(bp, LK_EXCLUSIVE);
2608 bp->b_flags = B_PHYS | B_FORMAT;
2607
2608 /*
2609 * calculate a fake blkno, so fdstrategy() would initiate a
2610 * seek to the requested cylinder
2611 */
2612 bp->b_blkno = (finfo->cyl * (fd->ft->sectrac * fd->ft->heads)
2613 + finfo->head * fd->ft->sectrac) * fdblk / DEV_BSIZE;
2614

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

2634 biodone(bp);
2635 }
2636 if (bp->b_flags & B_ERROR)
2637 rv = bp->b_error;
2638 /*
2639 * allow the process to be swapped
2640 */
2641 PRELE(p);
2609
2610 /*
2611 * calculate a fake blkno, so fdstrategy() would initiate a
2612 * seek to the requested cylinder
2613 */
2614 bp->b_blkno = (finfo->cyl * (fd->ft->sectrac * fd->ft->heads)
2615 + finfo->head * fd->ft->sectrac) * fdblk / DEV_BSIZE;
2616

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

2636 biodone(bp);
2637 }
2638 if (bp->b_flags & B_ERROR)
2639 rv = bp->b_error;
2640 /*
2641 * allow the process to be swapped
2642 */
2643 PRELE(p);
2644 BUF_UNLOCK(bp);
2645 BUF_FREELOCK(bp);
2642 free(bp, M_TEMP);
2643 return rv;
2644}
2645
2646/*
2647 * TODO: don't allocate buffer on stack.
2648 */
2649

--- 164 unchanged lines hidden ---
2646 free(bp, M_TEMP);
2647 return rv;
2648}
2649
2650/*
2651 * TODO: don't allocate buffer on stack.
2652 */
2653

--- 164 unchanged lines hidden ---