Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/udf Resort to the easiest way to check if a directory...



details:   https://anonhg.NetBSD.org/src/rev/2fd658fb5d64
branches:  trunk
changeset: 787899:2fd658fb5d64
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Thu Jul 11 19:41:19 2013 +0000

description:
Resort to the easiest way to check if a directory is deleted: the flag that
tells that there is no FID (dirent) pointing to it anymore.

diffstat:

 sys/fs/udf/udf_rename.c |  16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diffs (43 lines):

diff -r 61b2beaa8084 -r 2fd658fb5d64 sys/fs/udf/udf_rename.c
--- a/sys/fs/udf/udf_rename.c   Thu Jul 11 19:17:57 2013 +0000
+++ b/sys/fs/udf/udf_rename.c   Thu Jul 11 19:41:19 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_rename.c,v 1.3 2013/07/11 15:43:12 reinoud Exp $ */
+/* $NetBSD: udf_rename.c,v 1.4 2013/07/11 19:41:19 reinoud Exp $ */
 
 /*
  * Copyright (c) 2013 Reinoud Zandijk
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udf_rename.c,v 1.3 2013/07/11 15:43:12 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_rename.c,v 1.4 2013/07/11 19:41:19 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -480,23 +480,13 @@
 static bool
 udf_rmdired_p(struct vnode *vp)
 {
-       struct long_ad icb_loc;
-       const char *name;
-       int namelen;
-       int error, found;
-
        DPRINTF(CALL, ("udf_rmdired_p called\n"));
 
        KASSERT(vp != NULL);
        KASSERT(VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
        KASSERT(vp->v_type == VDIR);
 
-       /* get our node */
-       name    = "..";
-       namelen = 2;
-       error = udf_lookup_name_in_dir(vp, name, namelen,
-                       &icb_loc, &found);
-       return (error || !found);
+       return (VTOI(vp)->i_flags & IN_DELETED);
 }
 
 



Home | Main Index | Thread Index | Old Index