Module Name:    src
Committed By:   pooka
Date:           Sat Oct 17 23:19:52 UTC 2009

Modified Files:
        src/lib/libpuffs: dispatcher.c puffs.c puffs.h

Log Message:
Dispatch puffs_node_abortop().

Note: We use the storage of puffs_cache_write from puffs_ops for
this purpose.  It's not issued by the kernel and hence currently
unused, and this saves us from the trouble of bumping the lib major
version.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libpuffs/dispatcher.c
cvs rdiff -u -r1.98 -r1.99 src/lib/libpuffs/puffs.c
cvs rdiff -u -r1.110 -r1.111 src/lib/libpuffs/puffs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpuffs/dispatcher.c
diff -u src/lib/libpuffs/dispatcher.c:1.32 src/lib/libpuffs/dispatcher.c:1.33
--- src/lib/libpuffs/dispatcher.c:1.32	Tue Aug 12 19:44:39 2008
+++ src/lib/libpuffs/dispatcher.c	Sat Oct 17 23:19:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dispatcher.c,v 1.32 2008/08/12 19:44:39 pooka Exp $	*/
+/*	$NetBSD: dispatcher.c,v 1.33 2009/10/17 23:19:52 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006, 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: dispatcher.c,v 1.32 2008/08/12 19:44:39 pooka Exp $");
+__RCSID("$NetBSD: dispatcher.c,v 1.33 2009/10/17 23:19:52 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -828,6 +828,24 @@
 			break;
 		}
 
+		case PUFFS_VN_ABORTOP:
+		{
+			struct puffs_vnmsg_abortop *auxt = auxbuf;
+			struct puffs_cn pcn;
+
+			if (pops->puffs_node_abortop == NULL) {
+				error = 0;
+				break;
+			}
+
+			pcn.pcn_pkcnp = &auxt->pvnr_cn;
+			PUFFS_KCREDTOCRED(pcn.pcn_cred, &auxt->pvnr_cn_cred);
+
+			error = pops->puffs_node_abortop(pu, opcookie, &pcn);
+				
+			break;
+		}
+
 		case PUFFS_VN_READ:
 		{
 			struct puffs_vnmsg_read *auxt = auxbuf;
@@ -896,6 +914,8 @@
 			break;
 		}
 
+#if 0
+	/* not issued by kernel currently */
 	} else if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_CACHE) {
 		struct puffs_cacheinfo *pci = (void *)preq;
 
@@ -904,6 +924,7 @@
 			    pci->pcache_nruns, pci->pcache_runs);
 		}
 		error = 0;
+#endif
 
 	} else if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_ERROR) {
 		struct puffs_error *perr = (void *)preq;

Index: src/lib/libpuffs/puffs.c
diff -u src/lib/libpuffs/puffs.c:1.98 src/lib/libpuffs/puffs.c:1.99
--- src/lib/libpuffs/puffs.c:1.98	Thu Jan  8 02:28:08 2009
+++ src/lib/libpuffs/puffs.c	Sat Oct 17 23:19:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs.c,v 1.98 2009/01/08 02:28:08 lukem Exp $	*/
+/*	$NetBSD: puffs.c,v 1.99 2009/10/17 23:19:52 pooka Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: puffs.c,v 1.98 2009/01/08 02:28:08 lukem Exp $");
+__RCSID("$NetBSD: puffs.c,v 1.99 2009/10/17 23:19:52 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/param.h>
@@ -99,6 +99,7 @@
 	FILLOP(print,    PRINT);
 	FILLOP(read,     READ);
 	FILLOP(write,    WRITE);
+	FILLOP(abortop,  ABORTOP);
 }
 #undef FILLOP
 
@@ -586,21 +587,15 @@
 	return rv;
 }
 
+/*ARGSUSED*/
 struct puffs_usermount *
-_puffs_init(int develv, struct puffs_ops *pops, const char *mntfromname,
+_puffs_init(int dummy, struct puffs_ops *pops, const char *mntfromname,
 	const char *puffsname, void *priv, uint32_t pflags)
 {
 	struct puffs_usermount *pu;
 	struct puffs_kargs *pargs;
 	int sverrno;
 
-	if (develv != PUFFS_DEVEL_LIBVERSION) {
-		warnx("puffs_init: mounting with lib version %d, need %d",
-		    develv, PUFFS_DEVEL_LIBVERSION);
-		errno = EINVAL;
-		return NULL;
-	}
-
 	pu = malloc(sizeof(struct puffs_usermount));
 	if (pu == NULL)
 		goto failfree;

Index: src/lib/libpuffs/puffs.h
diff -u src/lib/libpuffs/puffs.h:1.110 src/lib/libpuffs/puffs.h:1.111
--- src/lib/libpuffs/puffs.h:1.110	Fri Dec 12 19:45:16 2008
+++ src/lib/libpuffs/puffs.h	Sat Oct 17 23:19:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs.h,v 1.110 2008/12/12 19:45:16 pooka Exp $	*/
+/*	$NetBSD: puffs.h,v 1.111 2009/10/17 23:19:52 pooka Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -218,10 +218,13 @@
 	    uint8_t *, off_t, size_t *, const struct puffs_cred *, int);
 	int (*puffs_node_write)(struct puffs_usermount *, puffs_cookie_t,
 	    uint8_t *, off_t, size_t *, const struct puffs_cred *, int);
+	int (*puffs_node_abortop)(struct puffs_usermount *, puffs_cookie_t,
+	    const struct puffs_cn *);
 
-	/* XXX: this shouldn't be here */
-	void (*puffs_cache_write)(struct puffs_usermount *,
-	    puffs_cookie_t, size_t, struct puffs_cacherun *);
+#if 0
+	/* enable next time this structure is changed */
+	void *puffs_ops_spare[32];
+#endif
 };
 
 typedef	int (*pu_pathbuild_fn)(struct puffs_usermount *,
@@ -354,8 +357,8 @@
 	int fsname##_node_write(struct puffs_usermount *,		\
 	    puffs_cookie_t, uint8_t *, off_t, size_t *,			\
 	    const struct puffs_cred *, int);				\
-	int fsname##_cache_write(struct puffs_usermount *,		\
-	    puffs_cookie_t, size_t, struct puffs_cacheinfo *);
+	int fsname##_node_abortop(struct puffs_usermount *,		\
+	    puffs_cookie_t, const struct puffs_cn *);
 
 #define PUFFSOP_INIT(ops)						\
     ops = malloc(sizeof(struct puffs_ops));				\

Reply via email to