Date: Fri, 3 Jan 2020 22:10:12 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356335 - head/sys/sys Message-ID: <202001032210.003MAC1Z062217@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Fri Jan 3 22:10:11 2020 New Revision: 356335 URL: https://svnweb.freebsd.org/changeset/base/356335 Log: vfs: add VOP_UNLOCK_FLAGS The flags argument from VOP_UNLOCK is about to be removed and some filesystems unlock the interlock as a convienience with it. Add a helper to retain the behavior for the few cases it is needed. Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jan 3 21:40:32 2020 (r356334) +++ head/sys/sys/vnode.h Fri Jan 3 22:10:11 2020 (r356335) @@ -955,6 +955,21 @@ int vn_chown(struct file *fp, uid_t uid, gid_t gid, st void vn_fsid(struct vnode *vp, struct vattr *va); +#define VOP_UNLOCK_FLAGS(vp, flags) ({ \ + struct vnode *_vp = (vp); \ + int _flags = (flags); \ + int _error; \ + \ + CTASSERT(__builtin_constant_p(flags) ? \ + (flags & ~(LK_INTERLOCK | LK_RELEASE)) == 0 : 1); \ + if ((_flags & ~(LK_INTERLOCK | LK_RELEASE)) != 0) \ + panic("%s: unsupported flags %x\n", __func__, flags); \ + _error = VOP_UNLOCK(_vp, 0); \ + if (_flags & LK_INTERLOCK) \ + VI_UNLOCK(_vp); \ + _error; \ +}) + #include <sys/kernel.h> #define VFS_VOP_VECTOR_REGISTER(vnodeops) \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001032210.003MAC1Z062217>