1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (c) 2003 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
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.
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.
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.
26 #include <linux/portals_compat25.h>
28 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
29 #define KDEVT_VAL(dev, val) dev.value = 0
31 #define KDEVT_VAL(dev, val) dev = 0
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)
38 # define PGCACHE_WRLOCK(mapping) spin_lock(&pagecache_lock)
39 # define PGCACHE_WRUNLOCK(mapping) spin_unlock(&pagecache_lock)
43 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
44 # define filemap_fdatasync(mapping) filemap_fdatawrite(mapping)
48 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
49 # define TryLockPage(page) TestSetPageLocked(page)
53 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
54 # define Page_Uptodate(page) PageUptodate(page)
57 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
58 # define USERMODEHELPER(path, argv, envp) call_usermodehelper(path, argv, envp, 0)
60 # define USERMODEHELPER(path, argv, envp) call_usermodehelper(path, argv, envp)
63 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
64 # define LL_CHECK_DIRTY(sb) do { }while(0)
66 # define LL_CHECK_DIRTY(sb) ll_check_dirty(sb)
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;
76 #endif /* _COMPAT25_H */