Introduce puffs_null_setops(), which initializes the ops vector with

puffs nullfs ops.
This commit is contained in:
pooka 2007-06-24 18:42:25 +00:00
parent a2b6c72725
commit 159e84cbd3
2 changed files with 35 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: null.c,v 1.16 2007/06/24 17:55:07 pooka Exp $ */
/* $NetBSD: null.c,v 1.17 2007/06/24 18:42:25 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
__RCSID("$NetBSD: null.c,v 1.16 2007/06/24 17:55:07 pooka Exp $");
__RCSID("$NetBSD: null.c,v 1.17 2007/06/24 18:42:25 pooka Exp $");
#endif /* !lint */
/*
@ -133,6 +133,34 @@ inodecmp(struct puffs_usermount *pu, struct puffs_node *pn, void *arg)
return NULL;
}
/* This should be called first and overriden from the file system */
void
puffs_null_setops(struct puffs_ops *pops)
{
PUFFSOP_SET(pops, puffs_null, fs, statvfs);
PUFFSOP_SETFSNOP(pops, unmount);
PUFFSOP_SETFSNOP(pops, sync);
PUFFSOP_SET(pops, puffs_null, node, lookup);
PUFFSOP_SET(pops, puffs_null, node, create);
PUFFSOP_SET(pops, puffs_null, node, mknod);
PUFFSOP_SET(pops, puffs_null, node, getattr);
PUFFSOP_SET(pops, puffs_null, node, setattr);
PUFFSOP_SET(pops, puffs_null, node, fsync);
PUFFSOP_SET(pops, puffs_null, node, remove);
PUFFSOP_SET(pops, puffs_null, node, link);
PUFFSOP_SET(pops, puffs_null, node, rename);
PUFFSOP_SET(pops, puffs_null, node, mkdir);
PUFFSOP_SET(pops, puffs_null, node, rmdir);
PUFFSOP_SET(pops, puffs_null, node, symlink);
PUFFSOP_SET(pops, puffs_null, node, readlink);
PUFFSOP_SET(pops, puffs_null, node, readdir);
PUFFSOP_SET(pops, puffs_null, node, read);
PUFFSOP_SET(pops, puffs_null, node, write);
PUFFSOP_SET(pops, puffs_null, node, reclaim);
}
/*ARGSUSED*/
int
puffs_null_fs_statvfs(struct puffs_cc *pcc, struct statvfs *svfsb, pid_t pid)

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs.h,v 1.63 2007/06/24 17:55:07 pooka Exp $ */
/* $NetBSD: puffs.h,v 1.64 2007/06/24 18:42:25 pooka Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -357,6 +357,8 @@ enum {
#define PUFFSOP_SETFSNOP(ops, opname) \
(ops)->puffs_fs_##opname = puffs_fsnop_##opname
PUFFSOP_PROTOS(puffs_null) /* XXX */
#define PUFFS_DEVEL_LIBVERSION 20
#define puffs_init(a,b,c,d) \
_puffs_init(PUFFS_DEVEL_LIBVERSION,a,b,c,d)
@ -446,6 +448,8 @@ void *puffs_pn_nodewalk(struct puffs_usermount *,
void puffs_setvattr(struct vattr *, const struct vattr *);
void puffs_vattr_null(struct vattr *);
void puffs_null_setops(struct puffs_ops *);
/*
* generic/dummy routines applicable for some file systems
*/