From: Francois Tigeot Date: Wed, 28 Mar 2012 11:52:36 +0000 (+0200) Subject: VFS accounting: small speed optimization X-Git-Tag: v3.4.0rc~1149^2~5 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/d4eea8cb1addde189e3a7e54d0962eecfeea7153?ds=sidebyside 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. --- diff --git a/sys/sys/mount.h b/sys/sys/mount.h index dadd883737..e3c3b1cbfb 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)