Deleted Added
full compact
md.c (179413) md.c (182371)
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 179413 2008-05-29 12:50:46Z ed $
9 * $FreeBSD: head/sys/dev/md/md.c 182371 2008-08-28 15:23:18Z attilio $
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 *

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

923 flags &= ~FWRITE;
924 NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, sc->file, td);
925 error = vn_open(&nd, &flags, 0, NULL);
926 if (error != 0)
927 return (error);
928 vfslocked = NDHASGIANT(&nd);
929 NDFREE(&nd, NDF_ONLY_PNBUF);
930 if (nd.ni_vp->v_type != VREG ||
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 *

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

923 flags &= ~FWRITE;
924 NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, sc->file, td);
925 error = vn_open(&nd, &flags, 0, NULL);
926 if (error != 0)
927 return (error);
928 vfslocked = NDHASGIANT(&nd);
929 NDFREE(&nd, NDF_ONLY_PNBUF);
930 if (nd.ni_vp->v_type != VREG ||
931 (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) {
931 (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred))) {
932 VOP_UNLOCK(nd.ni_vp, 0);
933 (void)vn_close(nd.ni_vp, flags, td->td_ucred, td);
934 VFS_UNLOCK_GIANT(vfslocked);
935 return (error ? error : EINVAL);
936 }
937 nd.ni_vp->v_vflag |= VV_MD;
938 VOP_UNLOCK(nd.ni_vp, 0);
939

--- 370 unchanged lines hidden ---
932 VOP_UNLOCK(nd.ni_vp, 0);
933 (void)vn_close(nd.ni_vp, flags, td->td_ucred, td);
934 VFS_UNLOCK_GIANT(vfslocked);
935 return (error ? error : EINVAL);
936 }
937 nd.ni_vp->v_vflag |= VV_MD;
938 VOP_UNLOCK(nd.ni_vp, 0);
939

--- 370 unchanged lines hidden ---