1 |
/* |
/* |
2 |
* security/ccsecurity/compat.h |
* security/ccsecurity/compat.h |
3 |
* |
* |
4 |
* Copyright (C) 2005-2009 NTT DATA CORPORATION |
* Copyright (C) 2005-2010 NTT DATA CORPORATION |
5 |
* |
* |
6 |
* Version: 1.7.1 2009/11/11 |
* Version: 1.8.0-pre 2010/08/01 |
7 |
* |
* |
8 |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
9 |
* See README.ccs for ChangeLog. |
* See README.ccs for ChangeLog. |
42 |
#define current_fsgid() (current->fsgid) |
#define current_fsgid() (current->fsgid) |
43 |
#endif |
#endif |
44 |
|
|
|
#ifndef WARN_ON |
|
|
#define WARN_ON(x) do { } while (0) |
|
|
#endif |
|
|
|
|
45 |
#ifndef DEFINE_SPINLOCK |
#ifndef DEFINE_SPINLOCK |
46 |
#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED |
#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED |
47 |
#endif |
#endif |
57 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) |
58 |
#define mutex semaphore |
#define mutex semaphore |
59 |
#define mutex_init(mutex) init_MUTEX(mutex) |
#define mutex_init(mutex) init_MUTEX(mutex) |
|
#define mutex_lock(mutex) down(mutex) |
|
60 |
#define mutex_unlock(mutex) up(mutex) |
#define mutex_unlock(mutex) up(mutex) |
61 |
|
#define mutex_lock(mutex) down(mutex) |
62 |
#define mutex_lock_interruptible(mutex) down_interruptible(mutex) |
#define mutex_lock_interruptible(mutex) down_interruptible(mutex) |
63 |
#define mutex_trylock(mutex) !down_trylock(mutex) |
#define mutex_trylock(mutex) (!down_trylock(mutex)) |
64 |
#define DEFINE_MUTEX(mutexname) DECLARE_MUTEX(mutexname) |
#define DEFINE_MUTEX(mutexname) DECLARE_MUTEX(mutexname) |
65 |
#endif |
#endif |
66 |
|
|
104 |
}) |
}) |
105 |
#endif |
#endif |
106 |
|
|
107 |
#ifndef list_for_each_rcu |
#ifndef list_for_each_entry_rcu |
108 |
#define list_for_each_rcu(pos, head) \ |
#define list_for_each_entry_rcu(pos, head, member) \ |
109 |
for (pos = rcu_dereference((head)->next); \ |
for (pos = list_entry(rcu_dereference((head)->next), \ |
110 |
prefetch(pos->next), pos != (head); \ |
typeof(*pos), member); \ |
111 |
pos = rcu_dereference(pos->next)) |
prefetch(pos->member.next), &pos->member != (head); \ |
112 |
|
pos = list_entry(rcu_dereference(pos->member.next), \ |
113 |
|
typeof(*pos), member)) |
114 |
#endif |
#endif |
115 |
|
|
116 |
#ifndef list_for_each_entry_rcu |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) |
117 |
#define list_for_each_entry_rcu(pos, head, member) \ |
#undef list_for_each_entry_rcu |
118 |
for (pos = list_entry(rcu_dereference((head)->next), typeof(*pos), \ |
#define list_for_each_entry_rcu(pos, head, member) \ |
119 |
member); \ |
for (pos = list_entry(srcu_dereference((head)->next, &ccs_ss), \ |
120 |
prefetch(pos->member.next), &pos->member != (head); \ |
typeof(*pos), member); \ |
121 |
pos = list_entry(rcu_dereference(pos->member.next), \ |
prefetch(pos->member.next), &pos->member != (head); \ |
122 |
|
pos = list_entry(srcu_dereference(pos->member.next, &ccs_ss), \ |
123 |
typeof(*pos), member)) |
typeof(*pos), member)) |
124 |
#endif |
#endif |
125 |
|
|
180 |
#define sk_family family |
#define sk_family family |
181 |
#define sk_protocol protocol |
#define sk_protocol protocol |
182 |
#define sk_type type |
#define sk_type type |
|
#define sk_receive_queue receive_queue |
|
183 |
static inline struct socket *SOCKET_I(struct inode *inode) |
static inline struct socket *SOCKET_I(struct inode *inode) |
184 |
{ |
{ |
185 |
return inode->i_sock ? &inode->u.socket_i : NULL; |
return inode->i_sock ? &inode->u.socket_i : NULL; |
201 |
#endif |
#endif |
202 |
|
|
203 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) |
|
#ifndef _STRUCT_PATH_DEFINED |
|
204 |
struct path { |
struct path { |
205 |
struct vfsmount *mnt; |
struct vfsmount *mnt; |
206 |
struct dentry *dentry; |
struct dentry *dentry; |
207 |
}; |
}; |
208 |
#endif |
#endif |
|
#endif |
|
209 |
|
|
210 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) |
211 |
|
|