fb-defio: If FBINFO_VIRTFB is defined, do not set VM_IO flag.
[safe/jmp/linux-2.6] / include / linux / key.h
index ad02d9c..e544f46 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/rbtree.h>
 #include <linux/rcupdate.h>
 #include <linux/sysctl.h>
+#include <linux/rwsem.h>
 #include <asm/atomic.h>
 
 #ifdef __KERNEL__
@@ -73,6 +74,7 @@ struct key;
 struct seq_file;
 struct user_struct;
 struct signal_struct;
+struct cred;
 
 struct key_type;
 struct key_owner;
@@ -181,7 +183,7 @@ struct key {
 extern struct key *key_alloc(struct key_type *type,
                             const char *desc,
                             uid_t uid, gid_t gid,
-                            struct task_struct *ctx,
+                            const struct cred *cred,
                             key_perm_t perm,
                             unsigned long flags);
 
@@ -249,7 +251,7 @@ extern int key_unlink(struct key *keyring,
                      struct key *key);
 
 extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
-                                struct task_struct *ctx,
+                                const struct cred *cred,
                                 unsigned long flags,
                                 struct key *dest);
 
@@ -264,7 +266,10 @@ extern int keyring_add_key(struct key *keyring,
 
 extern struct key *key_lookup(key_serial_t id);
 
-#define key_serial(key) ((key) ? (key)->serial : 0)
+static inline key_serial_t key_serial(struct key *key)
+{
+       return key ? key->serial : 0;
+}
 
 #ifdef CONFIG_SYSCTL
 extern ctl_table key_sysctls[];
@@ -273,42 +278,22 @@ extern ctl_table key_sysctls[];
 /*
  * the userspace interface
  */
-extern void switch_uid_keyring(struct user_struct *new_user);
-extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
-extern int copy_thread_group_keys(struct task_struct *tsk);
-extern void exit_keys(struct task_struct *tsk);
-extern void exit_thread_group_keys(struct signal_struct *tg);
-extern int suid_keys(struct task_struct *tsk);
-extern int exec_keys(struct task_struct *tsk);
+extern int install_thread_keyring_to_cred(struct cred *cred);
 extern void key_fsuid_changed(struct task_struct *tsk);
 extern void key_fsgid_changed(struct task_struct *tsk);
 extern void key_init(void);
 
-#define __install_session_keyring(tsk, keyring)                        \
-({                                                             \
-       struct key *old_session = tsk->signal->session_keyring; \
-       tsk->signal->session_keyring = keyring;                 \
-       old_session;                                            \
-})
-
 #else /* CONFIG_KEYS */
 
 #define key_validate(k)                        0
 #define key_serial(k)                  0
 #define key_get(k)                     ({ NULL; })
+#define key_revoke(k)                  do { } while(0)
 #define key_put(k)                     do { } while(0)
 #define key_ref_put(k)                 do { } while(0)
-#define make_key_ref(k, p)                     ({ NULL; })
-#define key_ref_to_ptr(k)              ({ NULL; })
+#define make_key_ref(k, p)             NULL
+#define key_ref_to_ptr(k)              NULL
 #define is_key_possessed(k)            0
-#define switch_uid_keyring(u)          do { } while(0)
-#define __install_session_keyring(t, k)        ({ NULL; })
-#define copy_keys(f,t)                 0
-#define copy_thread_group_keys(t)      0
-#define exit_keys(t)                   do { } while(0)
-#define exit_thread_group_keys(tg)     do { } while(0)
-#define suid_keys(t)                   do { } while(0)
-#define exec_keys(t)                   do { } while(0)
 #define key_fsuid_changed(t)           do { } while(0)
 #define key_fsgid_changed(t)           do { } while(0)
 #define key_init()                     do { } while(0)