Deleted Added
full compact
md.c (109192) md.c (109623)
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
9 * $FreeBSD: head/sys/dev/md/md.c 109192 2003-01-13 20:19:04Z phk $
9 * $FreeBSD: head/sys/dev/md/md.c 109623 2003-01-21 08:56:16Z alfred $
10 *
11 */
12
13/*
14 * The following functions are based in the vn(4) driver: mdstart_swap(),
15 * mdstart_vnode(), mdcreate_swap(), mdcreate_vnode() and mddestroy(),
16 * and as such under the following copyright:
17 *

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

754 }
755 if (sc->unit > max)
756 max = sc->unit;
757 }
758 if (unit == -1)
759 unit = max + 1;
760 if (unit > 255)
761 return (NULL);
10 *
11 */
12
13/*
14 * The following functions are based in the vn(4) driver: mdstart_swap(),
15 * mdstart_vnode(), mdcreate_swap(), mdcreate_vnode() and mddestroy(),
16 * and as such under the following copyright:
17 *

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

754 }
755 if (sc->unit > max)
756 max = sc->unit;
757 }
758 if (unit == -1)
759 unit = max + 1;
760 if (unit > 255)
761 return (NULL);
762 sc = (struct md_s *)malloc(sizeof *sc, M_MD, M_WAITOK | M_ZERO);
762 sc = (struct md_s *)malloc(sizeof *sc, M_MD, M_ZERO);
763 sc->unit = unit;
764 bioq_init(&sc->bio_queue);
765 mtx_init(&sc->queue_mtx, "md bio queue", NULL, MTX_DEF);
766 sprintf(sc->name, "md%d", unit);
767 error = kthread_create(md_kthread, sc, &sc->procp, 0, 0,"%s", sc->name);
768 if (error) {
769 free(sc, M_MD);
770 return (NULL);

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

913 /*
914 * Horrible kludge to establish credentials for NFS XXX.
915 */
916
917 if (sc->vnode) {
918 struct uio auio;
919 struct iovec aiov;
920
763 sc->unit = unit;
764 bioq_init(&sc->bio_queue);
765 mtx_init(&sc->queue_mtx, "md bio queue", NULL, MTX_DEF);
766 sprintf(sc->name, "md%d", unit);
767 error = kthread_create(md_kthread, sc, &sc->procp, 0, 0,"%s", sc->name);
768 if (error) {
769 free(sc, M_MD);
770 return (NULL);

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

913 /*
914 * Horrible kludge to establish credentials for NFS XXX.
915 */
916
917 if (sc->vnode) {
918 struct uio auio;
919 struct iovec aiov;
920
921 tmpbuf = malloc(sc->secsize, M_TEMP, M_WAITOK);
921 tmpbuf = malloc(sc->secsize, M_TEMP, 0);
922 bzero(&auio, sizeof(auio));
923
924 aiov.iov_base = tmpbuf;
925 aiov.iov_len = sc->secsize;
926 auio.uio_iov = &aiov;
927 auio.uio_iovcnt = 1;
928 auio.uio_offset = 0;
929 auio.uio_rw = UIO_READ;

--- 371 unchanged lines hidden ---
922 bzero(&auio, sizeof(auio));
923
924 aiov.iov_base = tmpbuf;
925 aiov.iov_len = sc->secsize;
926 auio.uio_iov = &aiov;
927 auio.uio_iovcnt = 1;
928 auio.uio_offset = 0;
929 auio.uio_rw = UIO_READ;

--- 371 unchanged lines hidden ---