From nobody Sun May 3 19:59:12 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g7wb513SVz6c11R for ; Sun, 03 May 2026 19:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g7wb45qwFz42Rp for ; Sun, 03 May 2026 19:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777838352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EqNFaA8SeKM7sT6PF20P/JAxn94YfV24KcQFHBt8+PM=; b=TLH3zpgby/Q0PESC8HHyNIfnyAkPnYfmn4krjLnHSKnsK61LeIVe8+O7YaIU/1uxO2/KO6 7ZD8jxbayFa01WHB3QwTNzwgEjtrv5wBVw1Ljf5yY6wfVdz1sedSRBTzM+RUXNMHkBIyaL UqsOXuNfPR67eT/uaFxwmAjZe/BlQrG0sNjDrHg1oPCdsEggQ591B6QiXJzXoMX/ClDGai WdmQL5pXzHu6+9C+UPtNYXnye2SDc4VaCZ2dTlVtL1820GrFDrutlKPQoKyPwTuWKl7C/r KYDTTNBSbJ66uRi8VEHbhDe2C7XHSfbIr0gqWiLh+6qoKm84GDJanfsnFoCGdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777838352; a=rsa-sha256; cv=none; b=lAav52pt1kebf6MoaU/rfA61uMOkYOpqP6pR9878jU79VLcQPRIqEIm1jn5iDBvb/Y+FQj 7brWJRu1msXPbR28IQyyFjFxTgfsBnW9Nm47mGLlLtycyrYxmpalrXkCujbmIfNEC7t2sj wga9W8zv5EXPRRw+wmJNlOBrg6T7EKbYatdmLWCb/OuSnNK8/GbHZcf6+aSTpT2ErmnItr M/hxwYvTbJ6O8iu9wgHLyTN7GS53dVS4seB/sp6xc00o1nuYpzir9XxOcGg/uRxni9uSFb jka9PPQPhQNzzZNkDIJaxr/AhZ3FLqLPoGeKb25tdsR+qFonodyv08PuNj9AzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777838352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EqNFaA8SeKM7sT6PF20P/JAxn94YfV24KcQFHBt8+PM=; b=IySDJtZb7NuD/hmFGpw3QBWIhcPW1+ns/0JDeUQiADRx4nQ0O6NL+BG78Wo06fAFOMT0eJ HTgQLHpha6s7Sl5zLpSZQBcTWUFtAW/+rq4CuyMPq23L+ADEci7lWZqLClcHljHuwaulQ9 1r+ytjEoWkBEv7qpwfmDTXAsMwqgozDs7N1m4yj+gr4csDurDq8941d7KeUOtydln/Bw7B +2FqRhh81rhJTkacg2fpuYJqp4688OHVS6bbXx0XIJI8RrOsyvC7s51NSRb74Dibwi+4w2 V0GlHGHkRFirwjtLYDsFZ+wEACzGIVSLkZN/M1TZk7ebi8nMxrtnWf048Mn4Pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g7wb45MX6znK5 for ; Sun, 03 May 2026 19:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40fe6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 03 May 2026 19:59:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 48bf024f2ef5 - main - vfs: convert VFS_OPs from macros to static inlines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48bf024f2ef5afeba3500bd92a04283370479edf Auto-Submitted: auto-generated Date: Sun, 03 May 2026 19:59:12 +0000 Message-Id: <69f7a910.40fe6.368262c3@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=48bf024f2ef5afeba3500bd92a04283370479edf commit 48bf024f2ef5afeba3500bd92a04283370479edf Author: Konstantin Belousov AuthorDate: 2026-04-24 01:31:27 +0000 Commit: Konstantin Belousov CommitDate: 2026-05-03 19:58:37 +0000 vfs: convert VFS_OPs from macros to static inlines Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D56611 --- sys/sys/mount.h | 230 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 121 insertions(+), 109 deletions(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 170201b82ac1..c96ce7d7b080 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -853,122 +853,134 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_MOUNT(MP) ({ \ - int _rc; \ - \ - TSRAW(curthread, TS_ENTER, "VFS_MOUNT", (MP)->mnt_vfc->vfc_name);\ - _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ - TSRAW(curthread, TS_EXIT, "VFS_MOUNT", (MP)->mnt_vfc->vfc_name);\ - _rc; }) - -#define VFS_UNMOUNT(MP, FORCE) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ - _rc; }) - -#define VFS_ROOT(MP, FLAGS, VPP) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ - _rc; }) - -#define VFS_CACHEDROOT(MP, FLAGS, VPP) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_cachedroot)(MP, FLAGS, VPP); \ - _rc; }) - -#define VFS_QUOTACTL(MP, C, U, A, MP_BUSY) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, MP_BUSY); \ - _rc; }) - -#define VFS_STATFS(MP, SBP) ({ \ - int _rc; \ - \ - _rc = __vfs_statfs((MP), (SBP)); \ - _rc; }) - -#define VFS_SYNC(MP, WAIT) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ - _rc; }) - -#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ - _rc; }) - -#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP); \ - _rc; }) - -#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ - SEC); \ - _rc; }) - -#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ - _rc; }) - -#define VFS_SYSCTL(MP, OP, REQ) ({ \ - int _rc; \ - \ - _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ - _rc; }) - -#define VFS_SUSP_CLEAN(MP) do { \ - if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ - (*(MP)->mnt_op->vfs_susp_clean)(MP); \ - } \ -} while (0) +static inline int +VFS_MOUNT(struct mount *mp) +{ + int rc; -#define VFS_RECLAIM_LOWERVP(MP, VP) do { \ - if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ - (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ - } \ -} while (0) + TSRAW(curthread, TS_ENTER, "VFS_MOUNT", mp->mnt_vfc->vfc_name); + rc = mp->mnt_op->vfs_mount(mp); + TSRAW(curthread, TS_EXIT, "VFS_MOUNT", mp->mnt_vfc->vfc_name); + return (rc); +} -#define VFS_UNLINK_LOWERVP(MP, VP) do { \ - if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \ - (*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \ - } \ -} while (0) +static inline int +VFS_UNMOUNT(struct mount *mp, int force) +{ + return (mp->mnt_op->vfs_unmount(mp, force)); +} -#define VFS_PURGE(MP) do { \ - if (*(MP)->mnt_op->vfs_purge != NULL) { \ - (*(MP)->mnt_op->vfs_purge)(MP); \ - } \ -} while (0) +static inline int +VFS_ROOT(struct mount *mp, int flags, struct vnode **vpp) +{ + return (mp->mnt_op->vfs_root(mp, flags, vpp)); +} + +static inline int +VFS_CACHEDROOT(struct mount *mp, int flags, struct vnode **vpp) +{ + return (mp->mnt_op->vfs_cachedroot(mp, flags, vpp)); +} + +static inline int +VFS_QUOTACTL(struct mount *mp, int cmds, uid_t uid, void *arg, bool *mp_busy) +{ + return (mp->mnt_op->vfs_quotactl(mp, cmds, uid, arg, mp_busy)); +} + +static inline int +VFS_STATFS(struct mount *mp, struct statfs *sbp) +{ + return (__vfs_statfs(mp, sbp)); +} + +static inline int +VFS_SYNC(struct mount *mp, int waitfor) +{ + return (mp->mnt_op->vfs_sync(mp, waitfor)); +} + +static inline int +VFS_VGET(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) +{ + return (mp->mnt_op->vfs_vget(mp, ino, flags, vpp)); +} + +static inline int +VFS_FHTOVP(struct mount *mp, struct fid *fidp, int flags, struct vnode **vpp) +{ + return (mp->mnt_op->vfs_fhtovp(mp, fidp, flags, vpp)); +} + +static inline int +VFS_CHECKEXP(struct mount *mp, struct sockaddr *nam, uint64_t *extflagsp, + struct ucred **credanonp, int *numsecflavors, int *secflavors) +{ + return (mp->mnt_op->vfs_checkexp(mp, nam, extflagsp, credanonp, + numsecflavors, secflavors)); +} + +static inline int +VFS_EXTATTRCTL(struct mount *mp, int cmd, struct vnode *filename_vp, + int attrnamespace, const char *attrname) +{ + return (mp->mnt_op->vfs_extattrctl(mp, cmd, filename_vp, + attrnamespace, attrname)); +} + +static inline int +VFS_SYSCTL(struct mount *mp, fsctlop_t op, struct sysctl_req *req) +{ + return (mp->mnt_op->vfs_sysctl(mp, op, req)); +} + +static inline void +VFS_SUSP_CLEAN(struct mount *mp) +{ + if (mp->mnt_op->vfs_susp_clean != NULL) + mp->mnt_op->vfs_susp_clean(mp); +} + +static inline void +VFS_RECLAIM_LOWERVP(struct mount *mp, struct vnode *vp) +{ + if (mp->mnt_op->vfs_reclaim_lowervp != NULL) + mp->mnt_op->vfs_reclaim_lowervp(mp, vp); +} + +static inline void +VFS_UNLINK_LOWERVP(struct mount *mp, struct vnode *vp) +{ + if (mp->mnt_op->vfs_unlink_lowervp != NULL) + mp->mnt_op->vfs_unlink_lowervp(mp, vp); +} + +static inline void +VFS_PURGE(struct mount *mp) +{ + if (mp->mnt_op->vfs_purge != NULL) + mp->mnt_op->vfs_purge(mp); +} #include -#define VFS_KNOTE_LOCKED(vp, hint) do \ -{ \ - if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) { \ - KNOTE_LOCKED(&vp->v_pollinfo->vpi_selinfo.si_note, \ - hint); \ - } \ -} while (0) +static inline void +VFS_KNOTE_LOCKED(struct vnode *vp, int hint) +{ + if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) { + KNOTE_LOCKED(&vp->v_pollinfo->vpi_selinfo.si_note, + hint); + } +} -#define VFS_KNOTE_UNLOCKED(vp, hint) do \ -{ \ - if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) { \ - KNOTE_UNLOCKED(&vp->v_pollinfo->vpi_selinfo.si_note, \ - hint); \ - } \ -} while (0) +static inline void +VFS_KNOTE_UNLOCKED(struct vnode *vp, int hint) +{ + if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) { + KNOTE_UNLOCKED(&vp->v_pollinfo->vpi_selinfo.si_note, + hint); + } +} #include