[PATCH 25.11 2/3] vhost: : remove fallbacks for old Linux versions
Bruce Richardson
bruce.richardson at intel.com
Mon Jun 30 15:29:03 CEST 2025
All supported linux versions support F_ADD_SEALS (Linux 3.17+) and
MFD_HUGETLB (Linux 4.14+), so no need to have #ifdefs and fallbacks to
support systems which do not support those features.
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
lib/vhost/vhost_user.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index b73dec6a22..4bfb13fb98 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -36,10 +36,7 @@
#ifdef RTE_LIBRTE_VHOST_POSTCOPY
#include <linux/userfaultfd.h>
#endif
-#ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
#include <linux/memfd.h>
-#define MEMFD_SUPPORTED
-#endif
#include <eal_export.h>
#include <rte_common.h>
@@ -1627,11 +1624,7 @@ inflight_mem_alloc(struct virtio_net *dev, const char *name, size_t size, int *f
char fname[20] = "/tmp/memfd-XXXXXX";
*fd = -1;
-#ifdef MEMFD_SUPPORTED
mfd = memfd_create(name, MFD_CLOEXEC);
-#else
- RTE_SET_USED(name);
-#endif
if (mfd == -1) {
mfd = mkstemp(fname);
if (mfd == -1) {
--
2.48.1
More information about the dev
mailing list