Module Name: src Committed By: hannken Date: Sun May 25 14:07:19 UTC 2014
Modified Files: src/sys/ufs/ext2fs: ext2fs_extern.h ext2fs_lookup.c Log Message: Remove ext2fs_checkpath(). It is a relic from the pre-genfs_rename era. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/ext2fs/ext2fs_extern.h cvs rdiff -u -r1.75 -r1.76 src/sys/ufs/ext2fs/ext2fs_lookup.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ufs/ext2fs/ext2fs_extern.h diff -u src/sys/ufs/ext2fs/ext2fs_extern.h:1.46 src/sys/ufs/ext2fs/ext2fs_extern.h:1.47 --- src/sys/ufs/ext2fs/ext2fs_extern.h:1.46 Wed Nov 21 23:11:23 2012 +++ src/sys/ufs/ext2fs/ext2fs_extern.h Sun May 25 14:07:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_extern.h,v 1.46 2012/11/21 23:11:23 jakllsch Exp $ */ +/* $NetBSD: ext2fs_extern.h,v 1.47 2014/05/25 14:07:19 hannken Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -128,7 +128,6 @@ int ext2fs_dirremove(struct vnode *, con int ext2fs_dirrewrite(struct inode *, const struct ufs_lookup_results *, struct inode *, struct componentname *); int ext2fs_dirempty(struct inode *, ino_t, kauth_cred_t); -int ext2fs_checkpath(struct inode *, struct inode *, kauth_cred_t); /* ext2fs_subr.c */ int ext2fs_blkatoff(struct vnode *, off_t, char **, struct buf **); Index: src/sys/ufs/ext2fs/ext2fs_lookup.c diff -u src/sys/ufs/ext2fs/ext2fs_lookup.c:1.75 src/sys/ufs/ext2fs/ext2fs_lookup.c:1.76 --- src/sys/ufs/ext2fs/ext2fs_lookup.c:1.75 Thu May 8 08:21:53 2014 +++ src/sys/ufs/ext2fs/ext2fs_lookup.c Sun May 25 14:07:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_lookup.c,v 1.75 2014/05/08 08:21:53 hannken Exp $ */ +/* $NetBSD: ext2fs_lookup.c,v 1.76 2014/05/25 14:07:19 hannken Exp $ */ /* * Modified for NetBSD 1.2E @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.75 2014/05/08 08:21:53 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.76 2014/05/25 14:07:19 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -985,70 +985,3 @@ ext2fs_dirempty(struct inode *ip, ino_t } return (1); } - -/* - * Check if source directory is in the path of the target directory. - * Target is supplied locked, source is unlocked. - * The target is always vput before returning. - */ -int -ext2fs_checkpath(struct inode *source, struct inode *target, - kauth_cred_t cred) -{ - struct vnode *vp; - int error, rootino, namlen; - struct ext2fs_dirtemplate dirbuf; - uint32_t ino; - - vp = ITOV(target); - if (target->i_number == source->i_number) { - error = EEXIST; - goto out; - } - rootino = UFS_ROOTINO; - error = 0; - if (target->i_number == rootino) - goto out; - - for (;;) { - if (vp->v_type != VDIR) { - error = ENOTDIR; - break; - } - error = vn_rdwr(UIO_READ, vp, (void *)&dirbuf, - sizeof (struct ext2fs_dirtemplate), (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED, cred, (size_t *)0, - NULL); - if (error != 0) - break; - namlen = dirbuf.dotdot_namlen; - if (namlen != 2 || - dirbuf.dotdot_name[0] != '.' || - dirbuf.dotdot_name[1] != '.') { - error = ENOTDIR; - break; - } - ino = fs2h32(dirbuf.dotdot_ino); - if (ino == source->i_number) { - error = EINVAL; - break; - } - if (ino == rootino) - break; - vput(vp); - error = VFS_VGET(vp->v_mount, ino, &vp); - if (error != 0) { - vp = NULL; - break; - } - } - -out: - if (error == ENOTDIR) { - printf("checkpath: .. not a directory\n"); - panic("checkpath"); - } - if (vp != NULL) - vput(vp); - return (error); -}