MilhouseVH stop systemd-243 udev complaints
- https://github.com/vmware/open-vm-tools/pull/371
+Josh Paetzel Changes to vmmemctl.ko and vmblock.ko for FreeBSD 13.0 API changes.
+ - https://github.com/vmware/open-vm-tools/pull/398
+
/*********************************************************
- * Copyright (C) 2008 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008, 2020 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
#if __FreeBSD_version >= 800011
#define COMPAT_THREAD_VAR(varname, varval)
#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags))
+#if __FreeBSD_version >= 1300074
+#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop))
+#else
#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags))
+#endif
#define compat_lockstatus(lock, threadvar) lockstatus((lock))
#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam))
#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags))
/* **********************************************************
- * Copyright 2007-2014 VMware, Inc. All rights reserved. -- VMware Confidential
+ * Copyright 2007-2014, 2020 VMware, Inc. All rights reserved. -- VMware Confidential
* **********************************************************/
/*
*/
{
struct vnode *vp = ap->a_vp;
+#if __FreeBSD_version < 1300074
int flags = ap->a_flags;
+#endif
COMPAT_THREAD_VAR(td, ap->a_td);
struct VMBlockNode *nn;
struct vnode *lvp;
int error;
+#if __FreeBSD_version < 1300074
/*
* If caller already holds interlock, drop it. (Per VOP_UNLOCK() API.)
* Also strip LK_INTERLOCK from flags passed to lower layer.
VI_UNLOCK(vp);
ap->a_flags = flags &= ~LK_INTERLOCK;
}
+#endif
nn = VPTOVMB(vp);
if (nn != NULL && (lvp = VMBVPTOLOWERVP(vp)) != NULL) {
+#if __FreeBSD_version < 1300074
error = COMPAT_VOP_UNLOCK(lvp, flags, td);
+#else
+ error = COMPAT_VOP_UNLOCK(lvp, 0, td);
+#endif
} else {
error = vop_stdunlock(ap);
}
/*********************************************************
- * Copyright (C) 2000,2014,2018-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2000,2014,2018-2020 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
typedef struct {
/* system structures */
+#if __FreeBSD_version >= 1300067
+ struct callout callout_handle;
+#else
struct callout_handle callout_handle;
+#endif
/* termination flag */
volatile int stop;
if (!t->stop) {
/* invoke registered handler, rearm timer */
Balloon_QueryAndExecute();
+#if __FreeBSD_version >= 1300067
+ callout_reset(&t->callout_handle, BALLOON_POLL_PERIOD * hz, vmmemctl_poll,
+ t);
+#else
t->callout_handle = timeout(vmmemctl_poll, t, BALLOON_POLL_PERIOD * hz);
+#endif
}
}
}
/* initialize timer state */
+#if __FreeBSD_version >= 1300067
+ callout_init(&state->timer.callout_handle, 0);
+#else
callout_handle_init(&state->timer.callout_handle);
+#endif
os_pmap_init(pmap);
os_balloonobject_create();
/* Set up and start polling */
- callout_handle_init(&t->callout_handle);
t->stop = FALSE;
+#if __FreeBSD_version >= 1300067
+ callout_reset(&t->callout_handle, BALLOON_POLL_PERIOD * hz, vmmemctl_poll,
+ t);
+#else
t->callout_handle = timeout(vmmemctl_poll, t, BALLOON_POLL_PERIOD * hz);
+#endif
vmmemctl_init_sysctl();
/* Stop polling */
t->stop = TRUE;
+#if __FreeBSD_version >= 1300067
+ callout_drain(&t->callout_handle);
+#else
untimeout(vmmemctl_poll, t, t->callout_handle);
+#endif
os_balloonobject_delete();
os_pmap_free(pmap);