aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-08-26 12:52:54 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-08-26 12:52:54 +0000
commit66fa11c898be3e66a5a9c2967358a2e26c6bbbe9 (patch)
treecdbcfe8d30e4a859015eff292f59340d6be619ba
parenteef63775b65a9f6d54f819eecea86e3873deb53c (diff)
downloadsrc-66fa11c898be3e66a5a9c2967358a2e26c6bbbe9.tar.gz
src-66fa11c898be3e66a5a9c2967358a2e26c6bbbe9.zip
cache: make it mandatory to request both timestamps or neither
Notes
Notes: svn path=/head/; revision=364814
-rw-r--r--sys/kern/vfs_cache.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 0a1e2819056f..147e94e22212 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -415,14 +415,12 @@ cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp)
(tsp == NULL && ticksp == NULL),
("No NCF_TS"));
- if (tsp == NULL && ticksp == NULL)
+ if (tsp == NULL)
return;
ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc);
- if (tsp != NULL)
- *tsp = ncp_ts->nc_time;
- if (ticksp != NULL)
- *ticksp = ncp_ts->nc_ticks;
+ *tsp = ncp_ts->nc_time;
+ *ticksp = ncp_ts->nc_ticks;
}
#ifdef DEBUG_CACHE
@@ -1617,6 +1615,8 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
bool whiteout;
u_short nc_flag;
+ MPASS((tsp == NULL && ticksp == NULL) || (tsp != NULL && ticksp != NULL));
+
#ifdef DEBUG_CACHE
if (__predict_false(!doingcache)) {
cnp->cn_flags &= ~MAKEENTRY;