Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Aug 2021 09:52:45 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b5eaf005273b - stable/13 - nullfs: provide custom null_advlock bypass
Message-ID:  <202108030952.1739qjhk081304@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=b5eaf005273b5e23db8e83e08b0bd32bbbbe1d53

commit b5eaf005273b5e23db8e83e08b0bd32bbbbe1d53
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-07-17 22:56:47 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-08-03 09:52:35 +0000

    nullfs: provide custom null_advlock bypass
    
    (cherry picked from commit 161e9a97363d17caf0b47983b28a37f3f59f9978)
---
 sys/fs/nullfs/null_vnops.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index 29be2a34614c..4dfc5efaf9ed 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -980,6 +980,28 @@ null_read_pgcache(struct vop_read_pgcache_args *ap)
 	return (error);
 }
 
+static int
+null_advlock(struct vop_advlock_args *ap)
+{
+	struct vnode *lvp, *vp;
+	struct null_node *xp;
+	int error;
+
+	vp = ap->a_vp;
+	VI_LOCK(vp);
+	xp = VTONULL(vp);
+	if (xp == NULL) {
+		VI_UNLOCK(vp);
+		return (EBADF);
+	}
+	lvp = xp->null_lowervp;
+	vref(lvp);
+	VI_UNLOCK(vp);
+	error = VOP_ADVLOCK(lvp, ap->a_id, ap->a_op, ap->a_fl, ap->a_flags);
+	vrele(lvp);
+	return (error);
+}
+
 /*
  * Avoid standard bypass, since lower dvp and vp could be no longer
  * valid after vput().
@@ -1035,6 +1057,7 @@ struct vop_vector null_vnodeops = {
 	.vop_bypass =		null_bypass,
 	.vop_access =		null_access,
 	.vop_accessx =		null_accessx,
+	.vop_advlock =		null_advlock,
 	.vop_advlockpurge =	vop_stdadvlockpurge,
 	.vop_bmap =		VOP_EOPNOTSUPP,
 	.vop_stat =		null_stat,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108030952.1739qjhk081304>