summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-03-30 08:51:46 +1100
committerJames Morris <jmorris@namei.org>2011-03-30 08:51:46 +1100
commit93b9c98b3498db5842e2812b32cff4c1ae947eb1 (patch)
tree2d18e46cadcbf66fff695bb16e86531281cde7be /include/linux
parentefb3bb4fad062f8e9b8c9c945d499597e14007e7 (diff)
parent5806896019ceaa0a1e808182afb4bba33c948ad6 (diff)
downloadlinux-93b9c98b3498db5842e2812b32cff4c1ae947eb1.tar.gz
linux-93b9c98b3498db5842e2812b32cff4c1ae947eb1.tar.bz2
linux-93b9c98b3498db5842e2812b32cff4c1ae947eb1.zip
Merge branch 'next-queue' into next
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/key.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index b2bb01719561..ef19b99aff98 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -276,6 +276,19 @@ static inline key_serial_t key_serial(struct key *key)
return key ? key->serial : 0;
}
+/**
+ * key_is_instantiated - Determine if a key has been positively instantiated
+ * @key: The key to check.
+ *
+ * Return true if the specified key has been positively instantiated, false
+ * otherwise.
+ */
+static inline bool key_is_instantiated(const struct key *key)
+{
+ return test_bit(KEY_FLAG_INSTANTIATED, &key->flags) &&
+ !test_bit(KEY_FLAG_NEGATIVE, &key->flags);
+}
+
#define rcu_dereference_key(KEY) \
(rcu_dereference_protected((KEY)->payload.rcudata, \
rwsem_is_locked(&((struct key *)(KEY))->sem)))