if (error == 0)
/* do not call vfs_acinit on mount updates */
if ((mp->mnt_flag & MNT_UPDATE) == 0)
- error = (mp->mnt_op->vfs_acinit)(mp);
+ VFS_ACINIT(mp,error);
VFS_MPUNLOCK(mp);
if (error == EMOUNTEXIT)
error = 0;
void *ctx;
VFS_MPLOCK1(mp);
- error = (mp->mnt_op->vfs_acdone)(mp);
- if (error == 0) {
- flags = mp->mnt_kern_flag;
- ctx = vn_syncer_thr_getctx(mp);
- error = (mp->mnt_op->vfs_unmount)(mp, mntflags);
- }
+ VFS_ACDONE(mp);
+ flags = mp->mnt_kern_flag;
+ ctx = vn_syncer_thr_getctx(mp);
+ error = (mp->mnt_op->vfs_unmount)(mp, mntflags);
if (error == 0 &&
flags & MNTK_THR_SYNC)
vn_syncer_thr_stop(ctx);
int attrnamespace, const char *attrname,
struct ucred *cred);
typedef int vfs_acinit_t(struct mount *mp);
-typedef int vfs_acdone_t(struct mount *mp);
+typedef void vfs_acdone_t(struct mount *mp);
typedef void vfs_account_t(struct mount *mp,
uid_t uid, gid_t gid, int64_t delta);
typedef void vfs_ncpgen_set_t(struct mount *mp, struct namecache *ncp);
#define VFS_ACCOUNT(MP, U, G, D) \
if ((MP->mnt_op->vfs_account != NULL) && (D != 0)) \
MP->mnt_op->vfs_account(MP, U, G, D);
+#define VFS_ACINIT(MP, ERROR) \
+ if (vfs_accounting_enabled && MP->mnt_op->vfs_acinit != NULL) \
+ ERROR = MP->mnt_op->vfs_acinit(MP);
+#define VFS_ACDONE(MP) \
+ if (vfs_accounting_enabled && MP->mnt_op->vfs_acdone != NULL) \
+ MP->mnt_op->vfs_acdone(MP);
#define VFS_NCPGEN_SET(MP, NCP) \
MP->mnt_op->vfs_ncpgen_set(MP, NCP)
#define VFS_NCPGEN_TEST(MP, NCP) \