Whamcloud - gitweb
- merge 0.7rc1 from b_devel to HEAD (20030612 merge point)
[fs/lustre-release.git] / lustre / include / linux / lustre_compat25.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (c) 2003 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  */
22
23 #ifndef _COMPAT25_H
24 #define _COMPAT25_H
25
26 #include <linux/portals_compat25.h>
27
28 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
29 #define KDEVT_VAL(dev, val)         dev.value = 0               
30 #else
31 #define KDEVT_VAL(dev, val)         dev = 0               
32 #endif
33
34 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
35 # define PGCACHE_WRLOCK(mapping)          write_lock(&mapping->page_lock)
36 # define PGCACHE_WRUNLOCK(mapping)        write_unlock(&mapping->page_lock)
37 #else
38 # define PGCACHE_WRLOCK(mapping)          spin_lock(&pagecache_lock)
39 # define PGCACHE_WRUNLOCK(mapping)        spin_unlock(&pagecache_lock)
40 #endif
41
42
43 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
44 # define filemap_fdatasync(mapping)       filemap_fdatawrite(mapping)
45 #endif
46
47
48 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
49 # define TryLockPage(page)                TestSetPageLocked(page)
50 #endif
51
52
53 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
54 # define Page_Uptodate(page)              PageUptodate(page)
55 #endif
56
57 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
58 # define USERMODEHELPER(path, argv, envp) call_usermodehelper(path, argv, envp, 0)
59 #else
60 # define USERMODEHELPER(path, argv, envp) call_usermodehelper(path, argv, envp)
61 #endif
62
63 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
64 # define LL_CHECK_DIRTY(sb)              do { }while(0)
65 #else
66 # define LL_CHECK_DIRTY(sb)              ll_check_dirty(sb)
67 #endif
68
69 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
70 #define  rb_node_s rb_node
71 #define  rb_root_s rb_root
72 typedef struct rb_root_s rb_root_t;
73 typedef struct rb_node_s rb_node_t;
74 #endif
75
76 #endif /* _COMPAT25_H */