diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2006-10-22 18:19:08 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2006-10-22 18:19:08 +0000 |
commit | b39be1b35ced251ca5f39addb70d3c28e6fd2d54 (patch) | |
tree | 0f4a309eda4fb9acf94037357f9d13df379af6c7 /sys/conf/files | |
parent | ecbbc8eeb2a4468fccc4662694ea56369fdee3c6 (diff) | |
download | src-b39be1b35ced251ca5f39addb70d3c28e6fd2d54.tar.gz src-b39be1b35ced251ca5f39addb70d3c28e6fd2d54.zip |
Add two new functions to convert FAT filesystem format timestamps
to and from struct timespec, to replace the crummy conversion
function which have been copy&pasted into three different
filesystems already.
Apart from general crummyness as indicated by code like:
for (year = 1970;; year++) {
inc = year & 0x03 ? 365 : 366;
if (days < inc)
break;
days -= inc;
}
They also contain specialized crummyness which tries to compensate
for the general crummyness by caching recent conversion results,
with no regard for locking or consistency.
These replacement functions are smaller, O(1) and handle the Y2.1K
leap-year correctly.
Ideally, these functions should live in a module of their own,
which the three offending filesystems would depend on, but the
size is 877 bytes of code (on i386), so that would be false
economy.
Notes
Notes:
svn path=/head/; revision=163611
Diffstat (limited to 'sys/conf/files')
-rw-r--r-- | sys/conf/files | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/conf/files b/sys/conf/files index e255f246a613..c257af430a14 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1374,6 +1374,7 @@ kern/subr_clock.c standard kern/subr_devstat.c standard kern/subr_disk.c standard kern/subr_eventhandler.c standard +kern/subr_fattime.c standard kern/subr_firmware.c optional firmware kern/subr_hints.c standard kern/subr_kdb.c standard |