From patchwork Tue Dec 3 09:31:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guillaume Le Vaillant X-Patchwork-Id: 16351 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6B167177FF; Tue, 3 Dec 2019 09:33:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 1BF6B1779F for ; Tue, 3 Dec 2019 09:33:40 +0000 (GMT) Received: from localhost ([::1]:50696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ic4Yt-0006Iy-Db for patchwork@mira.cbaines.net; Tue, 03 Dec 2019 04:33:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50828) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ic4XO-0005va-Hi for guix-patches@gnu.org; Tue, 03 Dec 2019 04:32:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ic4XL-0007QF-Ty for guix-patches@gnu.org; Tue, 03 Dec 2019 04:32:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ic4XL-0007Lf-MU for guix-patches@gnu.org; Tue, 03 Dec 2019 04:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ic4XK-0004Mx-Ir for guix-patches@gnu.org; Tue, 03 Dec 2019 04:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38468] [PATCH] file-systems: Add support for 'strict-atime' and 'lazy-time' flags. Resent-From: Guillaume Le Vaillant Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 Dec 2019 09:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38468 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38468@debbugs.gnu.org Cc: Guillaume Le Vaillant X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157536550916770 (code B ref -1); Tue, 03 Dec 2019 09:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2019 09:31:49 +0000 Received: from localhost ([127.0.0.1]:39281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ic4X7-0004MQ-Dy for submit@debbugs.gnu.org; Tue, 03 Dec 2019 04:31:49 -0500 Received: from lists.gnu.org ([209.51.188.17]:55225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ic4X5-0004MI-DD for submit@debbugs.gnu.org; Tue, 03 Dec 2019 04:31:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47128) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ic4X3-0005fN-KH for guix-patches@gnu.org; Tue, 03 Dec 2019 04:31:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ic4X1-0006GV-SU for guix-patches@gnu.org; Tue, 03 Dec 2019 04:31:45 -0500 Received: from mout02.posteo.de ([185.67.36.66]:58043) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ic4X1-0006Cg-4W for guix-patches@gnu.org; Tue, 03 Dec 2019 04:31:43 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id EDE322400E6 for ; Tue, 3 Dec 2019 10:31:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1575365501; bh=XN6yLUNF3cQ9g3xkItacaNxqNydjCzn87ig+/4Y5hJc=; h=From:To:Cc:Subject:Date:From; b=doqrzJT92N7y70ciyBcpjqU8IFs3Mkh3tXnUCm65D7Vz/c3Mx60r73gI8nRjyIjwx ditq5g2qkHWwdTCldEpGNUcjCzk+d63LB44DAlsglr5xPNi1WbFKoVbnaPWznC36jE 4HQ4MRs3PvkK5O5lzfz8nGhDHLQ4wx5kI6NGqyEO3LientSnkxNIoN2dm7VEK0U576 5VCWiJudcNyLlaGcuYBoGBQQYn4K2WmOAS7km/vJn59cSRiCeznRGKajpK4qelsg29 p8DmmkV+CGtkjHKhLVzFNywMY/D8iL6PL//BraRTrWRENgEw88//8D07pv3aPghfyq eCnVcKG4KhuHQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 47RxZH4JbRz9rxM; Tue, 3 Dec 2019 10:31:32 +0100 (CET) From: Guillaume Le Vaillant Date: Tue, 3 Dec 2019 10:31:08 +0100 Message-Id: <20191203093108.10422-1-glv@posteo.net> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/build/syscalls.scm (MS_LAZYTIME): New variable. * gnu/build/file-systems.scm (mount-flags->bit-mask): Add match rules for 'strict-atime' and 'lazy-time'. * doc/guix.texi (File Systems): Add 'strict-atime' and 'lazy-time' to the list of supported flags. --- doc/guix.texi | 9 ++++++--- gnu/build/file-systems.scm | 5 +++++ guix/build/syscalls.scm | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 2da1ecd64c..9b0677d775 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11244,9 +11244,12 @@ corresponding device mapping established. This is a list of symbols denoting mount flags. Recognized flags include @code{read-only}, @code{bind-mount}, @code{no-dev} (disallow access to special files), @code{no-suid} (ignore setuid and setgid -bits), @code{no-atime} (do not update file access times), and @code{no-exec} -(disallow program execution). @xref{Mount-Unmount-Remount,,, libc, The GNU C -Library Reference Manual}, for more information on these flags. +bits), @code{no-atime} (do not update file access times), +@code{strict-atime} (update file access time), @code{lazy-time} (only +update time on the in-memory version of the file inode), and +@code{no-exec} (disallow program execution). +@xref{Mount-Unmount-Remount,,, libc, The GNU C Library Reference +Manual}, for more information on these flags. @item @code{options} (default: @code{#f}) This is either @code{#f}, or a string denoting mount options passed to the diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index cb90fa0907..13c44aa728 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès ;;; Copyright © 2016, 2017 David Craven ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2019 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -577,6 +578,10 @@ corresponds to the symbols listed in FLAGS." (logior MS_NOEXEC (loop rest))) (('no-atime rest ...) (logior MS_NOATIME (loop rest))) + (('strict-atime rest ...) + (logior MS_STRICTATIME (loop rest))) + (('lazy-time rest ...) + (logior MS_LAZYTIME (loop rest))) (() 0)))) diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index ce7999b433..248d6761fc 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015 David Thompson ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2019 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -43,6 +44,7 @@ MS_BIND MS_MOVE MS_STRICTATIME + MS_LAZYTIME MNT_FORCE MNT_DETACH MNT_EXPIRE @@ -451,6 +453,7 @@ the returned procedure is called." (define MS_BIND 4096) (define MS_MOVE 8192) (define MS_STRICTATIME 16777216) +(define MS_LAZYTIME 33554432) (define MNT_FORCE 1) (define MNT_DETACH 2)