From 16dfd7eec153768e9213a8ba7b413eb126a1b10e Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sun, 2 Feb 2020 21:03:17 +0100 Subject: [PATCH] remoteloop: drop O_DIRECT Appart from giving us a hard time on s390x, this feature did not seem to have a measurable effect. Moreover, O_DIRECT is not supported by tmpfs so without this patch we could not use tmpfs as backing store, which does speed up image generation considerably. Drop the flag and and rather put the store on tmpfs in order to speed things up. --- osbuild/remoteloop.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osbuild/remoteloop.py b/osbuild/remoteloop.py index 5d1c7b1d..c6a9bc1d 100644 --- a/osbuild/remoteloop.py +++ b/osbuild/remoteloop.py @@ -4,7 +4,6 @@ import contextlib import errno import json import os -import platform import socket import threading from . import loop @@ -133,13 +132,8 @@ class LoopClient: def device(self, filename, offset=None, sizelimit=None): req = {} fds = array.array("i") - oflags = os.O_RDWR - if platform.machine() != "s390x": - # O_DIRECT will break s390x currently - oflags |= os.O_DIRECT - - fd = os.open(filename, oflags) + fd = os.open(filename, os.O_RDWR) dir_fd = os.open("/dev", os.O_DIRECTORY) fds.append(fd)