The modified time resolution is one second, so only
stat the cellservdb file at most only once per second.
Reviewed-on: http://gerrit.openafs.org/5743
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit
0e3bfa033ed230fcb46ad8e3c26c8b7aae6e00af)
Change-Id: Ia533d037cc772c085cfaad47035e2a29df64952e
Reviewed-on: http://gerrit.openafs.org/9435
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
#endif
struct stat tstat;
afs_int32 code;
+ time_t now = time(0);
+
+ if (adir->timeCheck == now) {
+ return 0; /* stat no more than once a second */
+ }
+ adir->timeCheck = now;
#ifdef AFS_NT40_ENV
/* NT client CellServDB has different file name than NT server or Unix */
#endif
adir->timeRead = 0; /* just in case */
+ adir->timeCheck = 0;
#ifdef AFS_NT40_ENV
/* NT client CellServDB has different file name than NT server or Unix */
struct afsconf_entry *entries; /* list of cell entries */
struct afsconf_keys *keystr; /* structure containing keys */
afs_int32 timeRead; /* time stamp of file last read */
+ afs_int32 timeCheck; /* time of last check for update */
struct afsconf_aliasentry *alias_entries; /* cell aliases */
};