Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/puffs Set SAVENAME for rmdir and remove.



details:   https://anonhg.NetBSD.org/src/rev/39047226caaa
branches:  trunk
changeset: 747531:39047226caaa
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sat Sep 19 11:44:19 2009 +0000

description:
Set SAVENAME for rmdir and remove.

Addresses an easy part of PR kern/38188

diffstat:

 sys/fs/puffs/puffs_vnops.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r 109ab345e4d3 -r 39047226caaa sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c        Sat Sep 19 11:02:07 2009 +0000
+++ b/sys/fs/puffs/puffs_vnops.c        Sat Sep 19 11:44:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_vnops.c,v 1.132 2009/09/12 18:17:55 tsutsui Exp $        */
+/*     $NetBSD: puffs_vnops.c,v 1.133 2009/09/19 11:44:19 pooka Exp $  */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.132 2009/09/12 18:17:55 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.133 2009/09/19 11:44:19 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -581,6 +581,13 @@
                cnp->cn_consume = MIN(lookup_msg->pvnr_cn.pkcn_consume,
                    strlen(cnp->cn_nameptr) - cnp->cn_namelen);
 
+       /*
+        * We need the name in remove and rmdir (well, rename too, but
+        * SAVESTART takes care of that)
+        */
+       if (cnp->cn_nameiop == DELETE)
+               cnp->cn_flags |= SAVENAME;
+
  out:
        if (cnp->cn_flags & ISDOTDOT)
                vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
@@ -1439,6 +1446,8 @@
        RELEPN_AND_VP(vp, pn);
 
        error = checkerr(pmp, error, __func__);
+       if (error || (cnp->cn_flags & SAVESTART) == 0)
+               PNBUF_PUT(cnp->cn_pnbuf);
        return error;
 }
 
@@ -1544,6 +1553,9 @@
        RELEPN_AND_VP(dvp, dpn);
        RELEPN_AND_VP(vp, pn);
 
+       if (error || (cnp->cn_flags & SAVESTART) == 0)
+               PNBUF_PUT(cnp->cn_pnbuf);
+
        return error;
 }
 



Home | Main Index | Thread Index | Old Index