#include <linux/string.h>
#include <linux/keyctl.h>
#include <linux/key-type.h>
+#include <linux/moduleparam.h>
#include <keys/user-type.h>
#include "cifspdu.h"
#include "cifsglob.h"
static const struct cred *root_cred;
+static unsigned int cifs_idmap_cache_timeout = 600;
+module_param(cifs_idmap_cache_timeout, uint, 0644);
+MODULE_PARM_DESC(cifs_idmap_cache_timeout, "Number of seconds that ID mappings "
+ "stay in cache. (default=600)");
+
static int
cifs_idmap_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
{
goto out_key_put;
}
cifs_copy_sid(ssid, (struct cifs_sid *)sidkey->payload.data);
+ key_set_timeout(sidkey, cifs_idmap_cache_timeout);
out_key_put:
key_put(sidkey);
out_revert_creds:
else
fgid = (gid_t)sidkey->payload.value;
+ key_set_timeout(sidkey, cifs_idmap_cache_timeout);
out_key_put:
key_put(sidkey);
out_revert_creds: