[Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

Panu Matilainen notifications at github.com
Tue Apr 4 08:45:47 UTC 2017

pmatilai commented on this pull request.

> @@ -231,6 +232,9 @@ static int expandRegular(rpmfi fi, const char *dest, rpmpsm psm, int nodigest, i
     if (wfd) {
 	int myerrno = errno;
+        if (rpmExpandNumeric("%{force_fsync_on_close}")) {

You don't really want to invoke the macro parser once per every single file within a transaction, more like once per transaction. But passing transaction config down to this level gets cumbersome, so for this I'd suggest using a static variable which is initialized once (grep for "oneshot" in build/ directory for an example)

The macro name should start with an underscore, as it's really rpm internal thing.

Also I wonder if we'd better name this macro for what it tries to achieve rather than the implementation detail of how exactly it does it - think of something along the lines of spreading or leveling the IO load, but as a native speaker you'll probably find some more fitting term for it. That'd leave the implementation open in case you come up with something even more effective. And who knows, somebody else in some datacenter might be interested too, but they'll never find an option called "fsync on close" :)

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170404/212f7e34/attachment-0001.html>

More information about the Rpm-maint mailing list