4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (c) 2011, 2012, Intel Corporation.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
37 #ifndef _LINUX_COMPAT25_H
38 #define _LINUX_COMPAT25_H
40 #include <linux/fs_struct.h>
41 #include <linux/namei.h>
43 #include "lustre_patchless_compat.h"
46 * set ATTR_BLOCKS to a high value to avoid any risk of collision with other
47 * ATTR_* attributes (see bug 13828)
49 #define ATTR_BLOCKS (1 << 27)
51 #define current_ngroups current_cred()->group_info->ngroups
52 #define current_groups current_cred()->group_info->small_block
55 * OBD need working random driver, thus all our
56 * initialization routines must be called after device
57 * driver initialization
61 #define module_init(a) late_initcall(a)
65 #define LTIME_S(time) (time.tv_sec)
67 /* inode_dio_wait(i) use as-is for write lock */
68 # define inode_dio_write_done(i) do {} while (0) /* for write unlock */
69 # define inode_dio_read(i) atomic_inc(&(i)->i_dio_count)
70 /* inode_dio_done(i) use as-is for read unlock */
74 #define FS_HAS_FIEMAP (0)
77 #define ll_vfs_rmdir(dir, entry, mnt) vfs_rmdir(dir, entry)
78 #define ll_vfs_mkdir(inode, dir, mnt, mode) vfs_mkdir(inode, dir, mode)
79 #define ll_vfs_link(old, mnt, dir, new, mnt1) vfs_link(old, dir, new)
80 #define ll_vfs_unlink(inode, entry, mnt) vfs_unlink(inode, entry)
81 #define ll_vfs_mknod(dir, entry, mnt, mode, dev) \
82 vfs_mknod(dir, entry, mode, dev)
83 #define ll_security_inode_unlink(dir, entry, mnt) \
84 security_inode_unlink(dir, entry)
85 #define ll_vfs_rename(old, old_dir, mnt, new, new_dir, mnt1) \
86 vfs_rename(old, old_dir, new, new_dir, NULL, 0)
88 #define cfs_bio_io_error(a, b) bio_io_error((a))
89 #define cfs_bio_endio(a, b, c) bio_endio((a), (c))
91 #define cfs_path_put(nd) path_put(&(nd)->path)
94 #ifndef SLAB_DESTROY_BY_RCU
95 #define SLAB_DESTROY_BY_RCU 0
101 ll_quota_on(struct super_block *sb, int off, int ver, char *name, int remount)
105 if (sb->s_qcop->quota_on) {
108 rc = kern_path(name, LOOKUP_FOLLOW, &path);
111 rc = sb->s_qcop->quota_on(sb, off, ver
120 static inline int ll_quota_off(struct super_block *sb, int off, int remount)
122 if (sb->s_qcop->quota_off) {
123 return sb->s_qcop->quota_off(sb, off
130 # define ll_vfs_dq_init dquot_initialize
131 # define ll_vfs_dq_drop dquot_drop
132 # define ll_vfs_dq_transfer dquot_transfer
133 # define ll_vfs_dq_off(sb, remount) dquot_suspend(sb, -1)
139 #define queue_max_phys_segments(rq) queue_max_segments(rq)
140 #define queue_max_hw_segments(rq) queue_max_segments(rq)
143 #define ll_d_hlist_node hlist_node
144 #define ll_d_hlist_empty(list) hlist_empty(list)
145 #define ll_d_hlist_entry(ptr, type, name) hlist_entry(ptr.first, type, name)
146 #define ll_d_hlist_for_each(tmp, i_dentry) hlist_for_each(tmp, i_dentry)
147 #define ll_d_hlist_for_each_entry(dentry, p, i_dentry, alias) \
148 p = NULL; hlist_for_each_entry(dentry, i_dentry, alias)
151 #define bio_hw_segments(q, bio) 0
154 #define ll_pagevec_init(pv, cold) do {} while (0)
155 #define ll_pagevec_add(pv, pg) (0)
156 #define ll_pagevec_lru_add_file(pv) do {} while (0)
163 # define NO_QUOTA (-EDQUOT)
167 #define SEEK_DATA 3 /* seek to the next data */
170 #define SEEK_HOLE 4 /* seek to the next hole */
173 #ifndef FMODE_UNSIGNED_OFFSET
174 #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
177 #if !defined(_ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_) && !defined(ext2_set_bit)
178 # define ext2_set_bit __test_and_set_bit_le
179 # define ext2_clear_bit __test_and_clear_bit_le
180 # define ext2_test_bit test_bit_le
181 # define ext2_find_first_zero_bit find_first_zero_bit_le
182 # define ext2_find_next_zero_bit find_next_zero_bit_le
185 #ifdef ATTR_TIMES_SET
186 # define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)
188 # define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET)
192 #include <linux/version.h>
193 #include <linux/fs.h>
195 # define ll_umode_t umode_t
197 #include <linux/dcache.h>
199 # define ll_dirty_inode(inode, flag) (inode)->i_sb->s_op->dirty_inode((inode), flag)
201 #endif /* _COMPAT25_H */