path: root/sys/sys/vnode.h
diff options
authorKonstantin Belousov <kib@FreeBSD.org>2021-01-29 23:48:55 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-02-17 23:22:05 +0000
commitfa3bd463cee5c3abeac29a83dc86eb3abfa97b06 (patch)
tree00effb7f68f6bd16e710dad29fb806ce2c2554e1 /sys/sys/vnode.h
parent351d06eeb509a420f3470c96b4a265467c87e2c2 (diff)
lockf: ensure atomicity of lockf for open(O_CREAT|O_EXCL|O_EXLOCK)
or EX_SHLOCK. Do it by setting a vnode iflag indicating that the locking exclusive open is in progress, and not allowing F_LOCK request to make a progress until the first open finishes. Requested by: mckusick Reviewed by: markj, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28697
Diffstat (limited to 'sys/sys/vnode.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 639a16881e09..9d68f9e236f6 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -254,6 +254,8 @@ struct xvnode {
#define VI_DOINGINACT 0x0004 /* VOP_INACTIVE is in progress */
#define VI_OWEINACT 0x0008 /* Need to call inactive */
#define VI_DEFINACT 0x0010 /* deferred inactive */
+#define VI_FOPENING 0x0020 /* In open, with opening process having the
+ first right to advlock file */
#define VV_ROOT 0x0001 /* root of its filesystem */
#define VV_ISTTY 0x0002 /* vnode represents a tty */