Add generic getattr routine.

This commit is contained in:
pooka 2007-12-19 14:01:16 +00:00
parent 3a04c46a48
commit a8e13cb420
2 changed files with 17 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs.h,v 1.101 2007/12/16 20:02:58 pooka Exp $ */
/* $NetBSD: puffs.h,v 1.102 2007/12/19 14:01:16 pooka Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -471,6 +471,9 @@ int puffs_fsnop_statvfs(struct puffs_usermount *, struct statvfs *);
void puffs_zerostatvfs(struct statvfs *);
int puffs_fsnop_sync(struct puffs_usermount *, int waitfor,
const struct puffs_cred *);
int puffs_genfs_node_getattr(struct puffs_usermount *, void *,
struct vattr *, const struct puffs_cred *);
int puffs_genfs_node_reclaim(struct puffs_usermount *, void *);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr.c,v 1.21 2007/11/30 19:02:29 pooka Exp $ */
/* $NetBSD: subr.c,v 1.22 2007/12/19 14:01:16 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
__RCSID("$NetBSD: subr.c,v 1.21 2007/11/30 19:02:29 pooka Exp $");
__RCSID("$NetBSD: subr.c,v 1.22 2007/12/19 14:01:16 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@ -110,6 +110,17 @@ puffs_fsnop_statvfs(struct puffs_usermount *dontuse1, struct statvfs *sbp)
return 0;
}
/*ARGSUSED3*/
int
puffs_genfs_node_getattr(struct puffs_usermount *pu, void *opc,
struct vattr *va, const struct puffs_cred *pcr)
{
struct puffs_node *pn = PU_CMAP(pu, opc);
memcpy(va, &pn->pn_va, sizeof(struct vattr));
return 0;
}
/*
* Just put the node, don't do anything else. Don't use this if
* your fs needs more cleanup.