summaryrefslogtreecommitdiffstats
path: root/sys/fs/pseudofs/pseudofs.h
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2007-03-12 12:16:52 +0000
committerdes <des@FreeBSD.org>2007-03-12 12:16:52 +0000
commit3d3e50beaf534ec30b151614f684eccd85ef5782 (patch)
treebf90ea580c06ca59d01616d80a1764d6c48580d1 /sys/fs/pseudofs/pseudofs.h
parenta3cbd559395af5e36b0ce853ee5218ddc911ff25 (diff)
downloadFreeBSD-src-3d3e50beaf534ec30b151614f684eccd85ef5782.zip
FreeBSD-src-3d3e50beaf534ec30b151614f684eccd85ef5782.tar.gz
Add a pn_destroy field to pfs_node. This field points to a destructor
function which is called from pfs_destroy() before the node is reclaimed. Modify pfs_create_{dir,file,link}() to accept a pointer to a destructor function in addition to the usual attr / fill / vis pointers. This breaks both the programming and binary interfaces between pseudofs and its consumers. It is believed that there are no pseudofs consumers outside the source tree, so that the impact of this change is minimal. Submitted by: Aniruddha Bohra <bohra@cs.rutgers.edu>
Diffstat (limited to 'sys/fs/pseudofs/pseudofs.h')
-rw-r--r--sys/fs/pseudofs/pseudofs.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/fs/pseudofs/pseudofs.h b/sys/fs/pseudofs/pseudofs.h
index b9701bc..58eba44 100644
--- a/sys/fs/pseudofs/pseudofs.h
+++ b/sys/fs/pseudofs/pseudofs.h
@@ -155,6 +155,15 @@ typedef int (*pfs_getextattr_t)(PFS_GETEXTATTR_ARGS);
typedef int (*pfs_close_t)(PFS_CLOSE_ARGS);
/*
+ * Destroy callback
+ */
+#define PFS_DESTROY_ARGS \
+ struct pfs_node *pn
+#define PFS_DESTROY_PROTO(name) \
+ int name(PFS_DESTROY_ARGS);
+typedef int (*pfs_destroy_t)(PFS_DESTROY_ARGS);
+
+/*
* pfs_info: describes a pseudofs instance
*/
struct pfs_info {
@@ -186,6 +195,7 @@ struct pfs_node {
pfs_attr_t pn_attr;
pfs_vis_t pn_vis;
pfs_getextattr_t pn_getextattr;
+ pfs_destroy_t pn_destroy;
void *pn_data;
int pn_flags;
@@ -215,13 +225,16 @@ int pfs_uninit (struct pfs_info *pi, struct vfsconf *vfc);
* Directory structure construction and manipulation
*/
struct pfs_node *pfs_create_dir (struct pfs_node *parent, const char *name,
- pfs_attr_t attr, pfs_vis_t vis, int flags);
+ pfs_attr_t attr, pfs_vis_t vis,
+ pfs_destroy_t destroy, int flags);
struct pfs_node *pfs_create_file(struct pfs_node *parent, const char *name,
pfs_fill_t fill, pfs_attr_t attr,
- pfs_vis_t vis, int flags);
+ pfs_vis_t vis, pfs_destroy_t destroy,
+ int flags);
struct pfs_node *pfs_create_link(struct pfs_node *parent, const char *name,
pfs_fill_t fill, pfs_attr_t attr,
- pfs_vis_t vis, int flags);
+ pfs_vis_t vis, pfs_destroy_t destroy,
+ int flags);
struct pfs_node *pfs_find_node (struct pfs_node *parent, const char *name);
int pfs_disable (struct pfs_node *pn);
int pfs_enable (struct pfs_node *pn);
OpenPOWER on IntegriCloud