file-systems: Support the 'no-atime' flag.

* guix/build/syscalls.scm (MS_NOATIME): New variable.
* gnu/build/file-systems.scm (mount-flags->bit-mask): Support it.
* doc/guix.texi (File Systems): Document it and add cross-references to
the relevant documentation.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
rendaw 2019-04-29 12:08:51 +02:00 committed by Ludovic Courtès
parent 2f8198dfed
commit 9d3053819d
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 11 additions and 2 deletions

View file

@ -10753,10 +10753,15 @@ corresponding device mapping established.
This is a list of symbols denoting mount flags. Recognized flags This is a list of symbols denoting mount flags. Recognized flags
include @code{read-only}, @code{bind-mount}, @code{no-dev} (disallow include @code{read-only}, @code{bind-mount}, @code{no-dev} (disallow
access to special files), @code{no-suid} (ignore setuid and setgid access to special files), @code{no-suid} (ignore setuid and setgid
bits), and @code{no-exec} (disallow program execution.) 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.
@item @code{options} (default: @code{#f}) @item @code{options} (default: @code{#f})
This is either @code{#f}, or a string denoting mount options. This is either @code{#f}, or a string denoting mount options passed to the
file system driver. @xref{Mount-Unmount-Remount,,, libc, The GNU C Library
Reference Manual}, for details and run @command{man 8 mount} for options for
various file systems.
@item @code{mount?} (default: @code{#t}) @item @code{mount?} (default: @code{#t})
This value indicates whether to automatically mount the file system when This value indicates whether to automatically mount the file system when

View file

@ -575,6 +575,8 @@ (define (mount-flags->bit-mask flags)
(logior MS_NODEV (loop rest))) (logior MS_NODEV (loop rest)))
(('no-exec rest ...) (('no-exec rest ...)
(logior MS_NOEXEC (loop rest))) (logior MS_NOEXEC (loop rest)))
(('no-atime rest ...)
(logior MS_NOATIME (loop rest)))
(() (()
0)))) 0))))

View file

@ -39,6 +39,7 @@ (define-module (guix build syscalls)
MS_NODEV MS_NODEV
MS_NOEXEC MS_NOEXEC
MS_REMOUNT MS_REMOUNT
MS_NOATIME
MS_BIND MS_BIND
MS_MOVE MS_MOVE
MS_STRICTATIME MS_STRICTATIME
@ -451,6 +452,7 @@ (define MS_NOSUID 2)
(define MS_NODEV 4) (define MS_NODEV 4)
(define MS_NOEXEC 8) (define MS_NOEXEC 8)
(define MS_REMOUNT 32) (define MS_REMOUNT 32)
(define MS_NOATIME 1024)
(define MS_BIND 4096) (define MS_BIND 4096)
(define MS_MOVE 8192) (define MS_MOVE 8192)
(define MS_STRICTATIME 16777216) (define MS_STRICTATIME 16777216)