/* check the security details of the on-disk cache */
int cachefiles_determine_cache_security(struct cachefiles_cache *cache, struct dentry *root, const struct cred **_saved_cred)
/* check the security details of the on-disk cache */
int cachefiles_determine_cache_security(struct cachefiles_cache *cache, struct dentry *root, const struct cred **_saved_cred)
{
	struct cred *new;
	int ret;
	_enter("");
	new = prepare_creds();
	if (!new)
		return -ENOMEM;
	cachefiles_end_secure(cache, *_saved_cred);
	ret = set_create_files_as(new, root->d_inode);
	if (ret < 0) {
		_leave(" = %d [cfa]", ret);
		return ret;
	}
	put_cred(cache->cache_cred);
	cache->cache_cred = new;
	cachefiles_begin_secure(cache, _saved_cred);
	ret = cachefiles_check_cache_dir(cache, root);
	if (ret == -EOPNOTSUPP)
		ret = 0;
	_leave(" = %d", ret);
	return ret;
}