Skip to contentSkip to conversation

filesystem time stamp resolution

DISCUSSION Ulrich Drepper 5 participants 7 messages Feb 26, 2009 – Feb 27, 2009

lore
Share & tools
lore
#0 lore raw

-----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-----

#1 lore raw
Quoted 5 lines · Ulrich Drepper

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?

#2 lore raw

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

Quoted 3 lines · Al Viro

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-----

#3 lore raw
Quoted 8 lines · Ulrich Drepper

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

Quoted 3 lines · Al Viro

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?

Quoted 6 lines

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..

#4 lore raw
In reply to Ulrich Drepper
Quoted 2 lines · Ulrich Drepper

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

Signature · 1 line
[email protected] -- Speaking for myself only.
#5 lore raw

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

Quoted 3 lines · Andi Kleen

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-----

#6 lore raw
Quoted 10 lines · Ulrich Drepper

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

Quoted 4 lines · Andi Kleen

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.

Quoted 6 lines

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