devfs_vnops.c (138290) | devfs_vnops.c (138509) |
---|---|
1/* 2 * Copyright (c) 2000-2004 3 * Poul-Henning Kamp. All rights reserved. 4 * Copyright (c) 1989, 1992-1993, 1995 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software donated to Berkeley by 8 * Jan-Simon Pendry. --- 17 unchanged lines hidden (view full) --- 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * 31 * @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95 32 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vnops.c 1.43 33 * | 1/* 2 * Copyright (c) 2000-2004 3 * Poul-Henning Kamp. All rights reserved. 4 * Copyright (c) 1989, 1992-1993, 1995 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software donated to Berkeley by 8 * Jan-Simon Pendry. --- 17 unchanged lines hidden (view full) --- 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * 31 * @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95 32 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vnops.c 1.43 33 * |
34 * $FreeBSD: head/sys/fs/devfs/devfs_vnops.c 138290 2004-12-01 23:16:38Z phk $ | 34 * $FreeBSD: head/sys/fs/devfs/devfs_vnops.c 138509 2004-12-07 08:15:41Z phk $ |
35 */ 36 37/* 38 * TODO: 39 * remove empty directories 40 * mknod: hunt down DE_DELETED, compare name, reinstantiate. 41 * mkdir: want it ? 42 */ --- 146 unchanged lines hidden (view full) --- 189 error = getnewvnode("devfs", mp, &devfs_vnodeops, &vp); 190 if (error != 0) { 191 printf("devfs_allocv: failed to allocate new vnode\n"); 192 return (error); 193 } 194 195 if (de->de_dirent->d_type == DT_CHR) { 196 vp->v_type = VCHR; | 35 */ 36 37/* 38 * TODO: 39 * remove empty directories 40 * mknod: hunt down DE_DELETED, compare name, reinstantiate. 41 * mkdir: want it ? 42 */ --- 146 unchanged lines hidden (view full) --- 189 error = getnewvnode("devfs", mp, &devfs_vnodeops, &vp); 190 if (error != 0) { 191 printf("devfs_allocv: failed to allocate new vnode\n"); 192 return (error); 193 } 194 195 if (de->de_dirent->d_type == DT_CHR) { 196 vp->v_type = VCHR; |
197 vp = addaliasu(vp, dev->si_udev); | 197 VI_LOCK(vp); 198 dev_lock(); 199 dev->si_refcount++; 200 vp->v_rdev = dev; 201 SLIST_INSERT_HEAD(&dev->si_hlist, vp, v_specnext); 202 dev->si_usecount += vp->v_usecount; 203 dev_unlock(); 204 VI_UNLOCK(vp); |
198 vp->v_op = &devfs_specops; 199 } else if (de->de_dirent->d_type == DT_DIR) { 200 vp->v_type = VDIR; 201 } else if (de->de_dirent->d_type == DT_LNK) { 202 vp->v_type = VLNK; 203 } else { 204 vp->v_type = VBAD; 205 } --- 1217 unchanged lines hidden --- | 205 vp->v_op = &devfs_specops; 206 } else if (de->de_dirent->d_type == DT_DIR) { 207 vp->v_type = VDIR; 208 } else if (de->de_dirent->d_type == DT_LNK) { 209 vp->v_type = VLNK; 210 } else { 211 vp->v_type = VBAD; 212 } --- 1217 unchanged lines hidden --- |