From d4eea8cb1addde189e3a7e54d0962eecfeea7153 Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Wed, 28 Mar 2012 13:52:36 +0200 Subject: [PATCH] VFS accounting: small speed optimization * Some operations may end up using the accounting macro with an effective zero bytes space usage difference * Avoid calling the whole mess and its associated mount-point spinlock in that case. --- sys/sys/mount.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index dadd883..e3c3b1c 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -622,7 +622,7 @@ struct vfsops { #define VFS_EXTATTRCTL(MP, C, FVP, NS, N, CRED) \ vfs_extattrctl(MP, C, FVP, NS, N, CRED) #define VFS_ACCOUNT(MP, U, G, D) \ - if (MP->mnt_op->vfs_account != NULL) \ + if ((MP->mnt_op->vfs_account != NULL) && (D != 0)) \ MP->mnt_op->vfs_account(MP, U, G, D); #define VFS_NCPGEN_SET(MP, NCP) \ MP->mnt_op->vfs_ncpgen_set(MP, NCP) -- 1.7.7.2