Revision 268,
1.1 KB
checked in by atzm, 10 years ago
(diff) |
optimize workqueues
|
Rev | Line | |
---|
[246] | 1 | /* |
---|
| 2 | * ksyslog: In-kernel syslog receiver |
---|
| 3 | * Copyright(C) 2013 Atzm WATANABE All rights reserved |
---|
| 4 | * Distributed under the GPL |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef KSYSLOG_COMPAT_H |
---|
| 8 | #define KSYSLOG_COMPAT_H |
---|
| 9 | |
---|
| 10 | #ifndef __list_for_each_rcu |
---|
| 11 | #define __list_for_each_rcu(pos, head) \ |
---|
| 12 | for (pos = rcu_dereference_raw(list_next_rcu(head)); \ |
---|
| 13 | pos != (head); \ |
---|
| 14 | pos = rcu_dereference_raw(list_next_rcu(pos))) |
---|
| 15 | #endif |
---|
| 16 | |
---|
[268] | 17 | #ifndef list_first_or_null_rcu |
---|
| 18 | #define list_first_or_null_rcu(ptr, type, member) \ |
---|
| 19 | ({ \ |
---|
| 20 | struct list_head *__ptr = (ptr); \ |
---|
| 21 | struct list_head *__next = ACCESS_ONCE(__ptr->next); \ |
---|
| 22 | likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \ |
---|
| 23 | }) |
---|
| 24 | #endif |
---|
| 25 | |
---|
[264] | 26 | static inline void |
---|
| 27 | compat_fsnotify_open(struct file *file) |
---|
| 28 | { |
---|
| 29 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) |
---|
| 30 | fsnotify_open(file->f_path.dentry); |
---|
| 31 | #else |
---|
| 32 | fsnotify_open(file); |
---|
| 33 | #endif |
---|
| 34 | } |
---|
| 35 | |
---|
[247] | 36 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) |
---|
[248] | 37 | static inline void |
---|
| 38 | udp_encap_enable(void) |
---|
[247] | 39 | { |
---|
| 40 | } |
---|
| 41 | #endif |
---|
| 42 | |
---|
[246] | 43 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) |
---|
| 44 | #ifdef CONFIG_PROC_FS |
---|
| 45 | static inline void * |
---|
| 46 | PDE_DATA(const struct inode *inode) |
---|
| 47 | { |
---|
| 48 | return PDE(inode)->data; |
---|
| 49 | } |
---|
| 50 | #endif |
---|
| 51 | #endif |
---|
| 52 | |
---|
| 53 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.