forked from adk9/9p-sac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
external-module-compat.h
86 lines (61 loc) · 1.71 KB
/
external-module-compat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef _LINUX_EXTMOD_COMPAT_H
#define _LINUX_EXTMOD_COMPAT_H
#include <linux/compiler.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/scatterlist.h>
#include <linux/fs.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
/* This is a really kludgy way to make it work. To see what
deactivate_locked_super is all about, check the commit
74dbbdd7fdc11763f4698d2f3e684cf4446951e6 by Al Viro */
static inline void deactivate_locked_super(struct super_block *s)
{
up_write(&s->s_umount);
deactivate_super(s);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
#define current_fsuid() (current->fsuid)
#define current_fsgid() (current->fsgid)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
struct virtio_device_id {
__u32 device;
__u32 vendor;
};
#define VIRTIO_DEV_ANY_ID 0xffffffff
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
#define COMPAT_kobject_uevent_env
#define sg_page(sg) ((sg)->page)
static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
{
memset(sgl, 0, sizeof(*sgl) * nents);
}
#define task_pid_nr(current) (0)
#define __mandatory_lock(ino) (0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
#define COMPAT_request_irq
#define COMPAT_INIT_WORK
#define COMPAT_f_dentry
typedef unsigned int bool;
#define true (1)
#define false (0)
#define uninitialized_var(x) x = x
#define list_first_entry(ptr, type, member) \
list_entry((ptr)->next, type, member)
static inline void * __must_check krealloc(const void *data, size_t size,
gfp_t gfp)
{
void *ret;
ret = kmalloc(size, gfp);
if (ret == NULL)
return ret;
memcpy(ret, data, min(size, ksize(data)));
kfree((void *)data);
return ret;
}
#endif
#endif
#endif
#endif
#endif
#endif