From owner-freebsd-current@FreeBSD.ORG Fri Jan 30 21:08:52 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E6EF1065673; Fri, 30 Jan 2009 21:08:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id C0FF88FC18; Fri, 30 Jan 2009 21:08:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LT00b-0003gn-Fm; Fri, 30 Jan 2009 22:30:37 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n0UKUYKW053714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Jan 2009 22:30:34 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n0UKUYJn017005; Fri, 30 Jan 2009 22:30:34 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n0UKUX5P017004; Fri, 30 Jan 2009 22:30:33 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 30 Jan 2009 22:30:33 +0200 From: Kostik Belousov To: Tim Kientzle Message-ID: <20090130203033.GB52415@deviant.kiev.zoral.com.ua> References: <30968.1233310214@critter.freebsd.dk> <49833352.3010208@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mxv5cy4qt+RJ9ypb" Content-Disposition: inline In-Reply-To: <49833352.3010208@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LT00b-0003gn-Fm c76b5b6e10fa092a8901cfb78cb387e0 X-Terabit: YES Cc: Poul-Henning Kamp , "'current@FreeBSD.org'" Subject: Re: RFC: Change mtree nsec handling? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 21:08:52 -0000 --mxv5cy4qt+RJ9ypb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 30, 2009 at 09:05:22AM -0800, Tim Kientzle wrote: > Poul-Henning Kamp wrote: > >In message <49829D49.10306@freebsd.org>, Tim Kientzle writes: > > > >>mtree support and the mtree(8) program, I found > >>that mtree formats timestamps rather strangely. > >> > >>For example, a timestamp of 1233295862.000001 > >>(1233295682 seconds and 1000 nanoseconds) > >>will be printed like this by mtree: > >> time=3D1233295862.1000 > >>Unsurprisingly, the mtree parsing works the same > >>way in reverse. > > > >>@@ -258,6 +259,8 @@ > >> val =3D ep + 1; > >> ip->st_mtimespec.tv_nsec > >> =3D strtoul(val, &ep, 10); > >>+ for (i =3D ep - val; i < 9; ++i) > >>+ ip->st_mtimespec.tv_nsec *=3D 10; > > > > > >Why is this bit needed ? > > >=20 > This is the part that converts 1233295862.000001 into > 1000 nanoseconds (instead of 1 nanosecond). >=20 > Two reasons: > 1) Documentation. It's much easier to document > "decimal seconds" than "period followed nine digits > representing the number of nanoseconds past the whole > second." > 2) Interoperability. I originally noticed this testing > other mtree-producing code against our mtree implementation. > For example, since FreeBSD filesystems never (?) store Look at the vfs.timestamp_precision sysctl in sys/kern/vfs_subr.c > higher resolution than microseconds, there's really > no reason to write more than 6 digits after the decimal > point. It seems a tad naive to assume that everyone > will always write 9 digits. >=20 > I can leave this out for a cycle if there's real concern. > Fractional seconds occur so rarely on FreeBSD systems > (to my knowledge, the kernel never spontaneously generates > them so they can only be created by tools like touch that > explicitly call utimes()) that I didn't think this > would affect any real applications. >=20 > But if I'm wrong.... >=20 > Tim > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" --mxv5cy4qt+RJ9ypb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmDY2kACgkQC3+MBN1Mb4jNRgCg27il8U7YkkoDwrKn++AzkjyB AVYAni0NYYRkZJIBO4F3o4Sc3jspkd+p =hpK9 -----END PGP SIGNATURE----- --mxv5cy4qt+RJ9ypb--