[PATCH] genirq: {en,dis}able_irq_wake() need refcounting too
[safe/jmp/linux-2.6] / include / linux / key.h
index 8c275d1..169f05e 100644 (file)
@@ -177,7 +177,8 @@ struct key {
 /*
  * kernel managed key type definition
  */
-typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, const char *op);
+typedef int (*request_key_actor_t)(struct key *key, struct key *authkey,
+                                  const char *op, void *aux);
 
 struct key_type {
        /* name of the type */
@@ -205,6 +206,11 @@ struct key_type {
        /* match a key against a description */
        int (*match)(const struct key *key, const void *desc);
 
+       /* clear some of the data from a key on revokation (optional)
+        * - the key's semaphore will be write-locked by the caller
+        */
+       void (*revoke)(struct key *key);
+
        /* clear the data from a key (optional) */
        void (*destroy)(struct key *key);
 
@@ -243,7 +249,14 @@ extern struct key *key_alloc(struct key_type *type,
                             const char *desc,
                             uid_t uid, gid_t gid,
                             struct task_struct *ctx,
-                            key_perm_t perm, int not_in_quota);
+                            key_perm_t perm,
+                            unsigned long flags);
+
+
+#define KEY_ALLOC_IN_QUOTA     0x0000  /* add to quota, reject if would overrun */
+#define KEY_ALLOC_QUOTA_OVERRUN        0x0001  /* add to quota, permit even if overrun */
+#define KEY_ALLOC_NOT_IN_QUOTA 0x0002  /* not in quota */
+
 extern int key_payload_reserve(struct key *key, size_t datalen);
 extern int key_instantiate_and_link(struct key *key,
                                    const void *data,
@@ -273,6 +286,11 @@ extern struct key *request_key(struct key_type *type,
                               const char *description,
                               const char *callout_info);
 
+extern struct key *request_key_with_auxdata(struct key_type *type,
+                                           const char *description,
+                                           const char *callout_info,
+                                           void *aux);
+
 extern int key_validate(struct key *key);
 
 extern key_ref_t key_create_or_update(key_ref_t keyring,
@@ -280,7 +298,7 @@ extern key_ref_t key_create_or_update(key_ref_t keyring,
                                      const char *description,
                                      const void *payload,
                                      size_t plen,
-                                     int not_in_quota);
+                                     unsigned long flags);
 
 extern int key_update(key_ref_t key,
                      const void *payload,
@@ -294,7 +312,7 @@ extern int key_unlink(struct key *keyring,
 
 extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
                                 struct task_struct *ctx,
-                                int not_in_quota,
+                                unsigned long flags,
                                 struct key *dest);
 
 extern int keyring_clear(struct key *keyring);