Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/miscfs/genfs Pull up revision 1.16 (requested by wr...



details:   https://anonhg.NetBSD.org/src/rev/4983e948de10
branches:  netbsd-2-0
changeset: 561238:4983e948de10
user:      tron <tron%NetBSD.org@localhost>
date:      Sun May 30 15:09:24 2004 +0000

description:
Pull up revision 1.16 (requested by wrstuden in ticket #424):
Since VOP_UPCALL() has been a long time in coming, add this partial
fix for layered-file-removal. It will work for the case of accessing
and deleting a file through the layered file system. Accessing via
the layer and deleting on the underlying still won't work, nor will
accessing via complicated structures (like two umap layers over a
given file systems).
We still need VOP_UPCALL(), but this is better than things were before.
This patch has been discussed off & on for a while. This incarnation
was tested by hannken at netbsd dot org.

diffstat:

 sys/miscfs/genfs/layer_vnops.c |  36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diffs (69 lines):

diff -r 1edc15bc8c24 -r 4983e948de10 sys/miscfs/genfs/layer_vnops.c
--- a/sys/miscfs/genfs/layer_vnops.c    Sun May 30 15:02:18 2004 +0000
+++ b/sys/miscfs/genfs/layer_vnops.c    Sun May 30 15:09:24 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: layer_vnops.c,v 1.14 2004/01/25 18:06:49 hannken Exp $ */
+/*     $NetBSD: layer_vnops.c,v 1.14.2.1 2004/05/30 15:09:24 tron Exp $        */
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -67,7 +67,7 @@
  *
  * Ancestors:
  *     @(#)lofs_vnops.c        1.2 (Berkeley) 6/18/92
- *     $Id: layer_vnops.c,v 1.14 2004/01/25 18:06:49 hannken Exp $
+ *     $Id: layer_vnops.c,v 1.14.2.1 2004/05/30 15:09:24 tron Exp $
  *     ...and...
  *     @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
  */
@@ -232,7 +232,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.14 2004/01/25 18:06:49 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.14.2.1 2004/05/30 15:09:24 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -750,13 +750,39 @@
         */
        VOP_UNLOCK(vp, 0);
 
-       /* ..., but don't cache the device node. */
-       if (vp->v_type == VBLK || vp->v_type == VCHR)
+       /*
+        * ..., but don't cache the device node. Also, if we did a
+        * remove, don't cache the node.
+        */
+       if (vp->v_type == VBLK || vp->v_type == VCHR
+           || (VTOLAYER(vp)->layer_flags & LAYERFS_REMOVED))
                vgone(vp);
        return (0);
 }
 
 int
+layer_remove(v)
+       void *v;
+{
+       struct vop_remove_args /* {
+               struct vonde            *a_dvp;
+               struct vnode            *a_vp;
+               struct componentname    *a_cnp;
+       } */ *ap = v;
+
+       int             error;
+       struct vnode    *vp = ap->a_vp;
+
+       vref(vp);
+       if ((error = LAYERFS_DO_BYPASS(vp, ap)) == 0)
+               VTOLAYER(vp)->layer_flags |= LAYERFS_REMOVED;
+
+       vrele(vp);
+
+       return (error);
+}
+
+int
 layer_reclaim(v)
        void *v;
 {



Home | Main Index | Thread Index | Old Index