#include "v9fs_vfs.h"
#include "cache.h"
+/* cache=loose default negative dentry retention time is 24hours */
+#define CACHE_LOOSE_NDENTRY_TIMEOUT_DEFAULT (24 * 60 * 60 * 1000)
+
static DEFINE_SPINLOCK(v9fs_sessionlist_lock);
static LIST_HEAD(v9fs_sessionlist);
struct kmem_cache *v9fs_inode_cache;
v9ses->uid = ctx->session_opts.uid;
v9ses->session_lock_timeout = ctx->session_opts.session_lock_timeout;
v9ses->ndentry_timeout_ms = ctx->session_opts.ndentry_timeout_ms;
+
+ /* If negative dentry timeout has not been overridden set default for
+ * cache=loose
+ */
+ if (!(v9ses->flags & V9FS_NDENTRY_TIMEOUT_SET) &&
+ (v9ses->cache & CACHE_LOOSE))
+ v9ses->ndentry_timeout_ms = CACHE_LOOSE_NDENTRY_TIMEOUT_DEFAULT;
}
/**