null_vnops.c (50477) | null_vnops.c (50616) |
---|---|
1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * John Heidemann of the UCLA Ficus project. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 23 unchanged lines hidden (view full) --- 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)null_vnops.c 8.6 (Berkeley) 5/27/95 37 * 38 * Ancestors: 39 * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 | 1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * John Heidemann of the UCLA Ficus project. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 23 unchanged lines hidden (view full) --- 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)null_vnops.c 8.6 (Berkeley) 5/27/95 37 * 38 * Ancestors: 39 * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 |
40 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 50477 1999-08-28 01:08:13Z peter $ | 40 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 50616 1999-08-30 07:08:04Z bde $ |
41 * ...and... 42 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project 43 * | 41 * ...and... 42 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project 43 * |
44 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 50477 1999-08-28 01:08:13Z peter $ | 44 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 50616 1999-08-30 07:08:04Z bde $ |
45 */ 46 47/* 48 * Null Layer 49 * 50 * (See mount_null(8) for more information.) 51 * 52 * The null layer duplicates a portion of the file system --- 148 unchanged lines hidden (view full) --- 201static int null_setattr __P((struct vop_setattr_args *ap)); 202static int null_unlock __P((struct vop_unlock_args *ap)); 203 204/* 205 * This is the 10-Apr-92 bypass routine. 206 * This version has been optimized for speed, throwing away some 207 * safety checks. It should still always work, but it's not as 208 * robust to programmer errors. | 45 */ 46 47/* 48 * Null Layer 49 * 50 * (See mount_null(8) for more information.) 51 * 52 * The null layer duplicates a portion of the file system --- 148 unchanged lines hidden (view full) --- 201static int null_setattr __P((struct vop_setattr_args *ap)); 202static int null_unlock __P((struct vop_unlock_args *ap)); 203 204/* 205 * This is the 10-Apr-92 bypass routine. 206 * This version has been optimized for speed, throwing away some 207 * safety checks. It should still always work, but it's not as 208 * robust to programmer errors. |
209 * Define SAFETY to include some error checking code. | |
210 * 211 * In general, we map all vnodes going down and unmap them on the way back. 212 * As an exception to this, vnodes can be marked "unmapped" by setting 213 * the Nth bit in operation's vdesc_flags. 214 * 215 * Also, some BSD vnode operations have the side effect of vrele'ing 216 * their arguments. With stacking, the reference counts are held 217 * by the upper node, not the lower one, so we must handle these --- 21 unchanged lines hidden (view full) --- 239 struct vnode **vps_p[VDESC_MAX_VPS]; 240 struct vnode ***vppp; 241 struct vnodeop_desc *descp = ap->a_desc; 242 int reles, i; 243 244 if (null_bug_bypass) 245 printf ("null_bypass: %s\n", descp->vdesc_name); 246 | 209 * 210 * In general, we map all vnodes going down and unmap them on the way back. 211 * As an exception to this, vnodes can be marked "unmapped" by setting 212 * the Nth bit in operation's vdesc_flags. 213 * 214 * Also, some BSD vnode operations have the side effect of vrele'ing 215 * their arguments. With stacking, the reference counts are held 216 * by the upper node, not the lower one, so we must handle these --- 21 unchanged lines hidden (view full) --- 238 struct vnode **vps_p[VDESC_MAX_VPS]; 239 struct vnode ***vppp; 240 struct vnodeop_desc *descp = ap->a_desc; 241 int reles, i; 242 243 if (null_bug_bypass) 244 printf ("null_bypass: %s\n", descp->vdesc_name); 245 |
247#ifdef SAFETY | 246#ifdef DIAGNOSTIC |
248 /* 249 * We require at least one vp. 250 */ 251 if (descp->vdesc_vp_offsets == NULL || 252 descp->vdesc_vp_offsets[0] == VDESC_NO_OFFSET) | 247 /* 248 * We require at least one vp. 249 */ 250 if (descp->vdesc_vp_offsets == NULL || 251 descp->vdesc_vp_offsets[0] == VDESC_NO_OFFSET) |
253 panic ("null_bypass: no vp's in map."); | 252 panic ("null_bypass: no vp's in map"); |
254#endif 255 256 /* 257 * Map the vnodes going in. 258 * Later, we'll invoke the operation based on 259 * the first mapped vnode's operation vector. 260 */ 261 reles = descp->vdesc_flags; --- 352 unchanged lines hidden --- | 253#endif 254 255 /* 256 * Map the vnodes going in. 257 * Later, we'll invoke the operation based on 258 * the first mapped vnode's operation vector. 259 */ 260 reles = descp->vdesc_flags; --- 352 unchanged lines hidden --- |