Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpuffs Dispatch puffs_node_abortop().
details: https://anonhg.NetBSD.org/src/rev/6689eb64be7d
branches: trunk
changeset: 748234:6689eb64be7d
user: pooka <pooka%NetBSD.org@localhost>
date: Sat Oct 17 23:19:52 2009 +0000
description:
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.
diffstat:
lib/libpuffs/dispatcher.c | 25 +++++++++++++++++++++++--
lib/libpuffs/puffs.c | 15 +++++----------
lib/libpuffs/puffs.h | 15 +++++++++------
3 files changed, 37 insertions(+), 18 deletions(-)
diffs (147 lines):
diff -r 067a18ad5f47 -r 6689eb64be7d lib/libpuffs/dispatcher.c
--- a/lib/libpuffs/dispatcher.c Sat Oct 17 23:16:05 2009 +0000
+++ b/lib/libpuffs/dispatcher.c Sat Oct 17 23:19:52 2009 +0000
@@ -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;
diff -r 067a18ad5f47 -r 6689eb64be7d lib/libpuffs/puffs.c
--- a/lib/libpuffs/puffs.c Sat Oct 17 23:16:05 2009 +0000
+++ b/lib/libpuffs/puffs.c Sat Oct 17 23:19:52 2009 +0000
@@ -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;
diff -r 067a18ad5f47 -r 6689eb64be7d lib/libpuffs/puffs.h
--- a/lib/libpuffs/puffs.h Sat Oct 17 23:16:05 2009 +0000
+++ b/lib/libpuffs/puffs.h Sat Oct 17 23:19:52 2009 +0000
@@ -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)); \
Home |
Main Index |
Thread Index |
Old Index