Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ext2fs Remove ext2fs_checkpath(). It is a relic fro...



details:   https://anonhg.NetBSD.org/src/rev/429f1c325bca
branches:  trunk
changeset: 796223:429f1c325bca
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun May 25 14:07:19 2014 +0000

description:
Remove ext2fs_checkpath().  It is a relic from the pre-genfs_rename era.

diffstat:

 sys/ufs/ext2fs/ext2fs_extern.h |   3 +-
 sys/ufs/ext2fs/ext2fs_lookup.c |  71 +----------------------------------------
 2 files changed, 3 insertions(+), 71 deletions(-)

diffs (106 lines):

diff -r 86398d7f58d1 -r 429f1c325bca sys/ufs/ext2fs/ext2fs_extern.h
--- a/sys/ufs/ext2fs/ext2fs_extern.h    Sun May 25 13:52:12 2014 +0000
+++ b/sys/ufs/ext2fs/ext2fs_extern.h    Sun May 25 14:07:19 2014 +0000
@@ -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_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 **);
diff -r 86398d7f58d1 -r 429f1c325bca sys/ufs/ext2fs/ext2fs_lookup.c
--- a/sys/ufs/ext2fs/ext2fs_lookup.c    Sun May 25 13:52:12 2014 +0000
+++ b/sys/ufs/ext2fs/ext2fs_lookup.c    Sun May 25 14:07:19 2014 +0000
@@ -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 @@
        }
        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);
-}



Home | Main Index | Thread Index | Old Index