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 --- 26 unchanged lines hidden (view full) --- 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 * ...and... 41 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project 42 * |
43 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 98175 2002-06-13 17:30:40Z semenu $ |
44 */ 45 46/* 47 * Null Layer 48 * 49 * (See mount_nullfs(8) for more information.) 50 * 51 * The null layer duplicates a portion of the filesystem --- 658 unchanged lines hidden (view full) --- 710static int 711null_inactive(ap) 712 struct vop_inactive_args /* { 713 struct vnode *a_vp; 714 struct thread *a_td; 715 } */ *ap; 716{ 717 struct vnode *vp = ap->a_vp; |
718 struct thread *td = ap->a_td; |
719 |
720 VOP_UNLOCK(vp, 0, td); 721 |
722 /* 723 * If this is the last reference, then free up the vnode 724 * so as not to tie up the lower vnodes. 725 */ |
726 vrecycle(vp, NULL, td); 727 |
728 return (0); 729} 730 731/* 732 * We can free memory in null_inactive, but we do this 733 * here. (Possible to guard vp->v_data to point somewhere) 734 */ 735static int --- 8 unchanged lines hidden (view full) --- 744 struct null_node *xp = VTONULL(vp); 745 struct vnode *lowervp = xp->null_lowervp; 746 void *vdata; 747 748 lockmgr(&null_hashlock, LK_EXCLUSIVE, NULL, td); 749 LIST_REMOVE(xp, null_hash); 750 lockmgr(&null_hashlock, LK_RELEASE, NULL, td); 751 |
752 /* 753 * Now it is safe to drop references to the lower vnode. 754 * VOP_INACTIVE() will be called by vrele() if necessary. 755 */ |
756 vrele(lowervp); 757 vrele(lowervp); |
758 759 vdata = vp->v_data; 760 vp->v_data = NULL; 761 FREE(vdata, M_NULLFSNODE); 762 763 return (0); 764} 765 --- 95 unchanged lines hidden --- |