devfs_vnops.c (109202) | devfs_vnops.c (109623) |
---|---|
1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 2000 5 * Poul-Henning Kamp. 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) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 2000 5 * Poul-Henning Kamp. 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 109202 2003-01-13 22:20:36Z phk $ | 34 * $FreeBSD: head/sys/fs/devfs/devfs_vnops.c 109623 2003-01-21 08:56:16Z alfred $ |
35 */ 36 37/* 38 * TODO: 39 * remove empty directories 40 * mknod: hunt down DE_DELETED, compare name, reinstantiate. 41 * mkdir: want it ? 42 */ --- 560 unchanged lines hidden (view full) --- 603 error = uiomove((caddr_t)dp, dp->d_reclen, uio); 604 if (error) 605 break; 606 } 607 off += dp->d_reclen; 608 } 609 if( !error && ap->a_ncookies != NULL && ap->a_cookies != NULL ) { 610 MALLOC(cookiebuf, u_long *, ncookies * sizeof(u_long), | 35 */ 36 37/* 38 * TODO: 39 * remove empty directories 40 * mknod: hunt down DE_DELETED, compare name, reinstantiate. 41 * mkdir: want it ? 42 */ --- 560 unchanged lines hidden (view full) --- 603 error = uiomove((caddr_t)dp, dp->d_reclen, uio); 604 if (error) 605 break; 606 } 607 off += dp->d_reclen; 608 } 609 if( !error && ap->a_ncookies != NULL && ap->a_cookies != NULL ) { 610 MALLOC(cookiebuf, u_long *, ncookies * sizeof(u_long), |
611 M_TEMP, M_WAITOK); | 611 M_TEMP, 0); |
612 cookiep = cookiebuf; 613 dps = (struct dirent *)((char *)uio->uio_iov->iov_base - 614 (uio->uio_offset - oldoff)); 615 dpe = (struct dirent *) uio->uio_iov->iov_base; 616 for( dp = dps; 617 dp < dpe; 618 dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) { 619 oldoff += dp->d_reclen; --- 234 unchanged lines hidden (view full) --- 854 dd = ap->a_dvp->v_data; 855 de = devfs_newdirent(ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen); 856 de->de_uid = 0; 857 de->de_gid = 0; 858 de->de_mode = 0755; 859 de->de_inode = dmp->dm_inode++; 860 de->de_dirent->d_type = DT_LNK; 861 i = strlen(ap->a_target) + 1; | 612 cookiep = cookiebuf; 613 dps = (struct dirent *)((char *)uio->uio_iov->iov_base - 614 (uio->uio_offset - oldoff)); 615 dpe = (struct dirent *) uio->uio_iov->iov_base; 616 for( dp = dps; 617 dp < dpe; 618 dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) { 619 oldoff += dp->d_reclen; --- 234 unchanged lines hidden (view full) --- 854 dd = ap->a_dvp->v_data; 855 de = devfs_newdirent(ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen); 856 de->de_uid = 0; 857 de->de_gid = 0; 858 de->de_mode = 0755; 859 de->de_inode = dmp->dm_inode++; 860 de->de_dirent->d_type = DT_LNK; 861 i = strlen(ap->a_target) + 1; |
862 MALLOC(de->de_symlink, char *, i, M_DEVFS, M_WAITOK); | 862 MALLOC(de->de_symlink, char *, i, M_DEVFS, 0); |
863 bcopy(ap->a_target, de->de_symlink, i); 864 lockmgr(&dmp->dm_lock, LK_EXCLUSIVE, 0, curthread); 865#ifdef MAC 866 mac_create_devfs_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de); 867#endif 868 TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list); 869 devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, 0); 870 lockmgr(&dmp->dm_lock, LK_RELEASE, 0, curthread); --- 50 unchanged lines hidden --- | 863 bcopy(ap->a_target, de->de_symlink, i); 864 lockmgr(&dmp->dm_lock, LK_EXCLUSIVE, 0, curthread); 865#ifdef MAC 866 mac_create_devfs_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de); 867#endif 868 TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list); 869 devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, 0); 870 lockmgr(&dmp->dm_lock, LK_RELEASE, 0, curthread); --- 50 unchanged lines hidden --- |