public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* filesystem time stamp resolution
@ 2009-02-26 23:18 Ulrich Drepper
  2009-02-26 23:54 ` Al Viro
  2009-02-27  8:48 ` Andi Kleen
  0 siblings, 2 replies; 7+ messages in thread
From: Ulrich Drepper @ 2009-02-26 23:18 UTC (permalink / raw)
  To: Linux Kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

How can code at userlevel (e.g., glibc) determine the resolution of the
a filesystem timestamp?

Boundary condition:

- - I cannot create or modify a file since the information must also
  be available for filesystems where the caller has no write permission

- - it has to work going forward (i.e., hardcoding information is no good
  idea)

One acceptable solution (for me) would be to have directories for the
filesystem types under /proc/fs (or /sys/fs) which show this
information.  E.g.:

  /proc/fs/ext4/timestamp-resolution

Measured in nano-seconds or so.

As a bonus have symlinks like

  /proc/fs/ef53 -> /proc/fs/ext4

(i.e., map the superblock magic number to a name.  But I can live with
this missing.)

As a second bonus any help for network filesystems would be good but.

Do I miss anything that is there already?

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmnIywACgkQ2ijCOnn/RHRSDgCfUep/fJohBr8kI+iuEFbanL5C
oXYAn03tnvPse68ewluvH5qrqJj02AEG
=W6ln
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: filesystem time stamp resolution
  2009-02-26 23:18 filesystem time stamp resolution Ulrich Drepper
@ 2009-02-26 23:54 ` Al Viro
  2009-02-26 23:57   ` Ulrich Drepper
  2009-02-27  8:48 ` Andi Kleen
  1 sibling, 1 reply; 7+ messages in thread
From: Al Viro @ 2009-02-26 23:54 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Linux Kernel

On Thu, Feb 26, 2009 at 03:18:04PM -0800, Ulrich Drepper wrote:
> information.  E.g.:
> 
>   /proc/fs/ext4/timestamp-resolution
> 
> Measured in nano-seconds or so.

Who said that it's not going to be dependent on the flags used to
create and/or mount the filesystem?  IOW, what makes you think that
knowing fs type will be enough to derive that data from?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: filesystem time stamp resolution
  2009-02-26 23:54 ` Al Viro
@ 2009-02-26 23:57   ` Ulrich Drepper
  2009-02-27  0:19     ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrich Drepper @ 2009-02-26 23:57 UTC (permalink / raw)
  To: Al Viro; +Cc: Linux Kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Al Viro wrote:
> Who said that it's not going to be dependent on the flags used to
> create and/or mount the filesystem?  IOW, what makes you think that
> knowing fs type will be enough to derive that data from?

Nothing.  Just the hope that the sanity of the users is a concern when
these features are designed.

Regardless, we need some sort of solution.  I just looked, there is
spare room in the kstatfs structure.  We could have a value returned in
a new f_tsres field or so.  That could be per mount point.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEUEARECAAYFAkmnLHgACgkQ2ijCOnn/RHT3FQCgnLHOPL/yItK0D7gZJv93EU0U
Dr0AmNTd35JdveTPHZ8tDUUfiltscoc=
=qIcS
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: filesystem time stamp resolution
  2009-02-26 23:57   ` Ulrich Drepper
@ 2009-02-27  0:19     ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2009-02-27  0:19 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Al Viro, Linux Kernel

On Thu, Feb 26, 2009 at 03:57:44PM -0800, Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Al Viro wrote:
> > Who said that it's not going to be dependent on the flags used to
> > create and/or mount the filesystem?  IOW, what makes you think that
> > knowing fs type will be enough to derive that data from?
> 
> Nothing.  Just the hope that the sanity of the users is a concern when
> these features are designed.
> 
> Regardless, we need some sort of solution.  I just looked, there is
> spare room in the kstatfs structure.  We could have a value returned in
> a new f_tsres field or so.  That could be per mount point.

Or finally get a pathconf syscall and inode operation..


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: filesystem time stamp resolution
  2009-02-26 23:18 filesystem time stamp resolution Ulrich Drepper
  2009-02-26 23:54 ` Al Viro
@ 2009-02-27  8:48 ` Andi Kleen
  2009-02-27 22:01   ` Ulrich Drepper
  1 sibling, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2009-02-27  8:48 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Linux Kernel

Ulrich Drepper <drepper@redhat.com> writes:

> How can code at userlevel (e.g., glibc) determine the resolution of the
> a filesystem timestamp?

One issue is network file systems. The kernel has no idea what a
remote NFS (or other network) file system will support, because it
depends on the file system on the remote server.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: filesystem time stamp resolution
  2009-02-27  8:48 ` Andi Kleen
@ 2009-02-27 22:01   ` Ulrich Drepper
  2009-02-27 22:23     ` Peter Staubach
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrich Drepper @ 2009-02-27 22:01 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Linux Kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andi Kleen wrote:
> One issue is network file systems. The kernel has no idea what a
> remote NFS (or other network) file system will support, because it
> depends on the file system on the remote server.

Hence my point in the initial mail saying this would be nice to have a
solution for.

Possibly some of the people working on the next NFS protocol revision
(or similar protocols) read this and add appropriate requests to the
protocol.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmoYs0ACgkQ2ijCOnn/RHRJNwCdH27Jyr5Aaf/iSXo3WD0ZZy62
T4gAn0ktzaf1X1+51RrhS4HrhRvgZk+t
=EWlQ
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: filesystem time stamp resolution
  2009-02-27 22:01   ` Ulrich Drepper
@ 2009-02-27 22:23     ` Peter Staubach
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Staubach @ 2009-02-27 22:23 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Andi Kleen, Linux Kernel

Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Andi Kleen wrote:
>   
>> One issue is network file systems. The kernel has no idea what a
>> remote NFS (or other network) file system will support, because it
>> depends on the file system on the remote server.
>>     
>
> Hence my point in the initial mail saying this would be nice to have a
> solution for.
>
> Possibly some of the people working on the next NFS protocol revision
> (or similar protocols) read this and add appropriate requests to the
> protocol.

The NFSv3 and NFSv4 protocols already contain such support.
NFSv2 implementations which also support the MOUNTv2
protocol can also support this facility too, I believe.

       ps

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-27 22:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26 23:18 filesystem time stamp resolution Ulrich Drepper
2009-02-26 23:54 ` Al Viro
2009-02-26 23:57   ` Ulrich Drepper
2009-02-27  0:19     ` Christoph Hellwig
2009-02-27  8:48 ` Andi Kleen
2009-02-27 22:01   ` Ulrich Drepper
2009-02-27 22:23     ` Peter Staubach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox