Fixed description of struct fuse_conn_info->time_gran
authorNikolaus Rath <Nikolaus@rath.org>
Fri, 7 Jul 2017 23:12:59 +0000 (01:12 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Fri, 7 Jul 2017 23:46:30 +0000 (01:46 +0200)
At least on Linux kernel 4.9, a value of zero gives more
than 1-sec accuracy.

ChangeLog.rst
include/fuse_common.h
lib/fuse_lowlevel.c

index 4fbce463a2e1ead9d34475b9a8fe6a7c640e208b..864642a6da45386ac0d5e63d69f7725211d5c507 100644 (file)
@@ -1,6 +1,9 @@
 Unreleased Changes
 ==================
 
+* Fixed description of the `fuse_conn_info->time_gran`. The default
+  value of zero actually corresponds to full nanosecond resolution,
+  not one second resolution.
 * The init script is now installed into the right location
   ($DESTDIR/etc/init.d rather than $prefix/$sysconfdir/init.d) 
 * The `example/passthrough_ll` filesystem now supports creating
index 6bb14f37243a566ad222703629b42d40ce57ff24..8bacec5bb506bcb6f564431c55c4792c21b18fc3 100644 (file)
@@ -406,8 +406,9 @@ struct fuse_conn_info {
         *
         * To prevent this problem, this variable can be used to inform the
         * kernel about the timestamp granularity supported by the file-system.
-        * The value should be power of 10.  A zero (default) value is
-        * equivalent to 1000000000 (1sec).
+        * The value should be power of 10.  The default is 1, i.e. full
+        * nano-second resolution. Filesystems supporting only second resolution
+        * should set this to 1000000000.
         */
        unsigned time_gran;
 
index c1c573fa2f83a6f22a8dc371515d0df5a37493ca..ccdb5a54b64bb15637d2f2cc8371a39ee05072ee 100644 (file)
@@ -1919,7 +1919,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
        LL_SET_DEFAULT(se->op.flock, FUSE_CAP_FLOCK_LOCKS);
        LL_SET_DEFAULT(se->op.readdirplus, FUSE_CAP_READDIRPLUS);
        LL_SET_DEFAULT(se->op.readdirplus, FUSE_CAP_READDIRPLUS_AUTO);
-
+       se->conn.time_gran = 1;
+       
        if (bufsize < FUSE_MIN_READ_BUFFER) {
                fprintf(stderr, "fuse: warning: buffer size too small: %zu\n",
                        bufsize);