1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
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
42 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
43 #error sorry, lustre requires at least linux kernel 2.6.9 or later
46 #include <libcfs/linux/portals_compat25.h>
48 #include <linux/lustre_patchless_compat.h>
50 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
53 unsigned int ia_attr_flags;
56 #define ll_iattr iattr
57 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) */
59 #ifndef HAVE_SET_FS_PWD
60 static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
61 struct dentry *dentry)
63 struct dentry *old_pwd;
64 struct vfsmount *old_pwdmnt;
66 write_lock(&fs->lock);
68 old_pwdmnt = fs->pwdmnt;
69 fs->pwdmnt = mntget(mnt);
70 fs->pwd = dget(dentry);
71 write_unlock(&fs->lock);
79 #define ll_set_fs_pwd set_fs_pwd
80 #endif /* HAVE_SET_FS_PWD */
83 * set ATTR_BLOCKS to a high value to avoid any risk of collision with other
84 * ATTR_* attributes (see bug 13828)
86 #define ATTR_BLOCKS (1 << 27)
88 #if HAVE_INODE_I_MUTEX
89 #define UNLOCK_INODE_MUTEX(inode) do {mutex_unlock(&(inode)->i_mutex); } while(0)
90 #define LOCK_INODE_MUTEX(inode) do {mutex_lock(&(inode)->i_mutex); } while(0)
91 #define LOCK_INODE_MUTEX_PARENT(inode) \
92 do {mutex_lock_nested(&(inode)->i_mutex, I_MUTEX_PARENT); } while(0)
93 #define TRYLOCK_INODE_MUTEX(inode) mutex_trylock(&(inode)->i_mutex)
95 #define UNLOCK_INODE_MUTEX(inode) do {up(&(inode)->i_sem); } while(0)
96 #define LOCK_INODE_MUTEX(inode) do {down(&(inode)->i_sem); } while(0)
97 #define TRYLOCK_INODE_MUTEX(inode) (!down_trylock(&(inode)->i_sem))
98 #define LOCK_INODE_MUTEX_PARENT(inode) LOCK_INODE_MUTEX(inode)
99 #endif /* HAVE_INODE_I_MUTEX */
101 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
102 #define d_child d_u.d_child
103 #define d_rcu d_u.d_rcu
106 #ifdef HAVE_DQUOTOFF_MUTEX
107 #define UNLOCK_DQONOFF_MUTEX(dqopt) do {mutex_unlock(&(dqopt)->dqonoff_mutex); } while(0)
108 #define LOCK_DQONOFF_MUTEX(dqopt) do {mutex_lock(&(dqopt)->dqonoff_mutex); } while(0)
110 #define UNLOCK_DQONOFF_MUTEX(dqopt) do {up(&(dqopt)->dqonoff_sem); } while(0)
111 #define LOCK_DQONOFF_MUTEX(dqopt) do {down(&(dqopt)->dqonoff_sem); } while(0)
112 #endif /* HAVE_DQUOTOFF_MUTEX */
114 #define current_ngroups current->group_info->ngroups
115 #define current_groups current->group_info->small_block
118 #define page_private(page) ((page)->private)
119 #define set_page_private(page, v) ((page)->private = (v))
126 #define lock_dentry(___dentry) spin_lock(&(___dentry)->d_lock)
127 #define unlock_dentry(___dentry) spin_unlock(&(___dentry)->d_lock)
129 #define ll_kernel_locked() kernel_locked()
132 * OBD need working random driver, thus all our
133 * initialization routines must be called after device
134 * driver initialization
138 #define module_init(a) late_initcall(a)
141 /* XXX our code should be using the 2.6 calls, not the other way around */
142 #define TryLockPage(page) TestSetPageLocked(page)
143 #define Page_Uptodate(page) PageUptodate(page)
144 #define ll_redirty_page(page) set_page_dirty(page)
146 #define KDEVT_INIT(val) (val)
148 #define LTIME_S(time) (time.tv_sec)
149 #define ll_path_lookup path_lookup
150 #define ll_permission(inode,mask,nd) permission(inode,mask,nd)
152 #define ll_pgcache_lock(mapping) spin_lock(&mapping->page_lock)
153 #define ll_pgcache_unlock(mapping) spin_unlock(&mapping->page_lock)
154 #define ll_call_writepage(inode, page) \
155 (inode)->i_mapping->a_ops->writepage(page, NULL)
156 #define ll_invalidate_inode_pages(inode) \
157 invalidate_inode_pages((inode)->i_mapping)
158 #define ll_truncate_complete_page(page) \
159 truncate_complete_page(page->mapping, page)
161 #define ll_vfs_create(a,b,c,d) vfs_create(a,b,c,d)
162 #define ll_dev_t dev_t
164 #define to_kdev_t(dev) (dev)
165 #define kdev_t_to_nr(dev) (dev)
166 #define val_to_kdev(dev) (dev)
167 #define ILOOKUP(sb, ino, test, data) ilookup5(sb, ino, test, data);
169 #include <linux/writeback.h>
171 static inline int cleanup_group_info(void)
173 struct group_info *ginfo;
175 ginfo = groups_alloc(0);
179 set_current_groups(ginfo);
180 put_group_info(ginfo);
185 #define __set_page_ll_data(page, llap) \
187 page_cache_get(page); \
188 SetPagePrivate(page); \
189 set_page_private(page, (unsigned long)llap); \
191 #define __clear_page_ll_data(page) \
193 ClearPagePrivate(page); \
194 set_page_private(page, 0); \
195 page_cache_release(page); \
200 #include <linux/proc_fs.h>
202 #if !defined(HAVE_D_REHASH_COND) && defined(HAVE___D_REHASH)
203 #define d_rehash_cond(dentry, lock) __d_rehash(dentry, lock)
204 extern void __d_rehash(struct dentry *dentry, int lock);
207 #if !defined(HAVE_D_MOVE_LOCKED) && defined(HAVE___D_MOVE)
208 #define d_move_locked(dentry, target) __d_move(dentry, target)
209 extern void __d_move(struct dentry *dentry, struct dentry *target);
212 #ifdef HAVE_CAN_SLEEP_ARG
213 #define ll_flock_lock_file_wait(file, lock, can_sleep) \
214 flock_lock_file_wait(file, lock, can_sleep)
216 #define ll_flock_lock_file_wait(file, lock, can_sleep) \
217 flock_lock_file_wait(file, lock)
220 #define CheckWriteback(page, cmd) \
221 ((!PageWriteback(page) && (cmd & OBD_BRW_READ)) || \
222 (PageWriteback(page) && (cmd & OBD_BRW_WRITE)))
224 #ifdef HAVE_PAGE_LIST
225 static inline int mapping_has_pages(struct address_space *mapping)
229 ll_pgcache_lock(mapping);
230 if (list_empty(&mapping->dirty_pages) &&
231 list_empty(&mapping->clean_pages) &&
232 list_empty(&mapping->locked_pages)) {
235 ll_pgcache_unlock(mapping);
240 static inline int mapping_has_pages(struct address_space *mapping)
242 return mapping->nrpages > 0;
246 #ifdef HAVE_KIOBUF_KIO_BLOCKS
247 #define KIOBUF_GET_BLOCKS(k) ((k)->kio_blocks)
249 #define KIOBUF_GET_BLOCKS(k) ((k)->blocks)
252 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7))
253 #define ll_set_dflags(dentry, flags) do { dentry->d_vfs_flags |= flags; } while(0)
254 #define ll_vfs_symlink(dir, dentry, path, mode) vfs_symlink(dir, dentry, path)
256 #define ll_set_dflags(dentry, flags) do { \
257 spin_lock(&dentry->d_lock); \
258 dentry->d_flags |= flags; \
259 spin_unlock(&dentry->d_lock); \
261 #ifdef HAVE_SECURITY_PLUG
262 #define ll_vfs_symlink(dir, dentry, mnt, path, mode) \
263 vfs_symlink(dir, dentry, mnt, path, mode)
265 #define ll_vfs_symlink(dir, dentry, mnt, path, mode) \
266 vfs_symlink(dir, dentry, path, mode)
271 #define container_of(ptr, type, member) ({ \
272 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
273 (type *)( (char *)__mptr - offsetof(type,member) );})
276 #ifdef HAVE_I_ALLOC_SEM
277 #define UP_WRITE_I_ALLOC_SEM(i) do { up_write(&(i)->i_alloc_sem); } while (0)
278 #define DOWN_WRITE_I_ALLOC_SEM(i) do { down_write(&(i)->i_alloc_sem); } while(0)
279 #define LASSERT_I_ALLOC_SEM_WRITE_LOCKED(i) LASSERT(down_read_trylock(&(i)->i_alloc_sem) == 0)
281 #define UP_READ_I_ALLOC_SEM(i) do { up_read(&(i)->i_alloc_sem); } while (0)
282 #define DOWN_READ_I_ALLOC_SEM(i) do { down_read(&(i)->i_alloc_sem); } while (0)
283 #define LASSERT_I_ALLOC_SEM_READ_LOCKED(i) LASSERT(down_write_trylock(&(i)->i_alloc_sem) == 0)
285 #define UP_READ_I_ALLOC_SEM(i) do { } while (0)
286 #define DOWN_READ_I_ALLOC_SEM(i) do { } while (0)
287 #define LASSERT_I_ALLOC_SEM_READ_LOCKED(i) do { } while (0)
289 #define UP_WRITE_I_ALLOC_SEM(i) do { } while (0)
290 #define DOWN_WRITE_I_ALLOC_SEM(i) do { } while (0)
291 #define LASSERT_I_ALLOC_SEM_WRITE_LOCKED(i) do { } while (0)
294 #ifndef HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP
295 #define grab_cache_page_nowait_gfp(x, y, z) grab_cache_page_nowait((x), (y))
298 #ifndef HAVE_FILEMAP_FDATAWRITE
299 #define filemap_fdatawrite(mapping) filemap_fdatasync(mapping)
302 #include <linux/mpage.h> /* for generic_writepages */
303 #ifndef HAVE_FILEMAP_FDATAWRITE_RANGE
304 #include <linux/backing-dev.h> /* for mapping->backing_dev_info */
305 static inline int filemap_fdatawrite_range(struct address_space *mapping,
306 loff_t start, loff_t end)
309 struct writeback_control wbc = {
310 .sync_mode = WB_SYNC_ALL,
311 .nr_to_write = (end - start + PAGE_SIZE - 1) >> PAGE_SHIFT,
314 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
315 wbc.range_start = start;
322 #ifdef mapping_cap_writeback_dirty
323 if (!mapping_cap_writeback_dirty(mapping))
326 if (mapping->backing_dev_info->memory_backed)
329 /* do_writepages() */
330 else if (mapping->a_ops->writepages)
331 rc = mapping->a_ops->writepages(mapping, &wbc);
333 rc = generic_writepages(mapping, &wbc);
337 int filemap_fdatawrite_range(struct address_space *mapping,
338 loff_t start, loff_t end);
341 #ifdef HAVE_VFS_KERN_MOUNT
344 ll_kern_mount(const char *fstype, int flags, const char *name, void *data)
346 struct file_system_type *type = get_fs_type(fstype);
347 struct vfsmount *mnt;
349 return ERR_PTR(-ENODEV);
350 mnt = vfs_kern_mount(type, flags, name, data);
351 module_put(type->owner);
355 #define ll_kern_mount(fstype, flags, name, data) do_kern_mount((fstype), (flags), (name), (data))
358 #ifdef HAVE_STATFS_DENTRY_PARAM
359 #define ll_do_statfs(sb, sfs) (sb)->s_op->statfs((sb)->s_root, (sfs))
361 #define ll_do_statfs(sb, sfs) (sb)->s_op->statfs((sb), (sfs))
365 #ifndef HAVE_TASK_PPTR
366 #define p_pptr parent
369 #ifndef HAVE_SB_TIME_GRAN
370 #ifndef HAVE_S_TIME_GRAN
371 #error Need s_time_gran patch!
373 static inline u32 get_sb_time_gran(struct super_block *sb)
375 return sb->s_time_gran;
379 #ifdef HAVE_RW_TREE_LOCK
380 #define TREE_READ_LOCK_IRQ(mapping) read_lock_irq(&(mapping)->tree_lock)
381 #define TREE_READ_UNLOCK_IRQ(mapping) read_unlock_irq(&(mapping)->tree_lock)
383 #define TREE_READ_LOCK_IRQ(mapping) spin_lock_irq(&(mapping)->tree_lock)
384 #define TREE_READ_UNLOCK_IRQ(mapping) spin_unlock_irq(&(mapping)->tree_lock)
387 #ifdef HAVE_UNREGISTER_BLKDEV_RETURN_INT
388 #define ll_unregister_blkdev(a,b) unregister_blkdev((a),(b))
391 int ll_unregister_blkdev(unsigned int dev, const char *name)
393 unregister_blkdev(dev, name);
398 #ifdef HAVE_INVALIDATE_BDEV_2ARG
399 #define ll_invalidate_bdev(a,b) invalidate_bdev((a),(b))
401 #define ll_invalidate_bdev(a,b) invalidate_bdev((a))
404 #ifdef HAVE_INODE_BLKSIZE
405 #define ll_inode_blksize(a) (a)->i_blksize
407 #define ll_inode_blksize(a) (1<<(a)->i_blkbits)
410 #ifdef HAVE_FS_RENAME_DOES_D_MOVE
411 #define LL_RENAME_DOES_D_MOVE FS_RENAME_DOES_D_MOVE
413 #define LL_RENAME_DOES_D_MOVE FS_ODD_RENAME
416 /* add a lustre compatible layer for crypto API */
417 #include <linux/crypto.h>
418 #ifdef HAVE_ASYNC_BLOCK_CIPHER
419 #define ll_crypto_hash crypto_hash
420 #define ll_crypto_cipher crypto_blkcipher
421 #define ll_crypto_alloc_hash(name, type, mask) crypto_alloc_hash(name, type, mask)
422 #define ll_crypto_hash_setkey(tfm, key, keylen) crypto_hash_setkey(tfm, key, keylen)
423 #define ll_crypto_hash_init(desc) crypto_hash_init(desc)
424 #define ll_crypto_hash_update(desc, sl, bytes) crypto_hash_update(desc, sl, bytes)
425 #define ll_crypto_hash_final(desc, out) crypto_hash_final(desc, out)
426 #define ll_crypto_alloc_blkcipher(name, type, mask) \
427 crypto_alloc_blkcipher(name ,type, mask)
428 #define ll_crypto_blkcipher_setkey(tfm, key, keylen) \
429 crypto_blkcipher_setkey(tfm, key, keylen)
430 #define ll_crypto_blkcipher_set_iv(tfm, src, len) \
431 crypto_blkcipher_set_iv(tfm, src, len)
432 #define ll_crypto_blkcipher_get_iv(tfm, dst, len) \
433 crypto_blkcipher_get_iv(tfm, dst, len)
434 #define ll_crypto_blkcipher_encrypt(desc, dst, src, bytes) \
435 crypto_blkcipher_encrypt(desc, dst, src, bytes)
436 #define ll_crypto_blkcipher_decrypt(desc, dst, src, bytes) \
437 crypto_blkcipher_decrypt(desc, dst, src, bytes)
438 #define ll_crypto_blkcipher_encrypt_iv(desc, dst, src, bytes) \
439 crypto_blkcipher_encrypt_iv(desc, dst, src, bytes)
440 #define ll_crypto_blkcipher_decrypt_iv(desc, dst, src, bytes) \
441 crypto_blkcipher_decrypt_iv(desc, dst, src, bytes)
443 static inline int ll_crypto_hmac(struct ll_crypto_hash *tfm,
444 u8 *key, unsigned int *keylen,
445 struct scatterlist *sg,
446 unsigned int size, u8 *result)
448 struct hash_desc desc;
452 rv = crypto_hash_setkey(desc.tfm, key, *keylen);
454 CERROR("failed to hash setkey: %d\n", rv);
457 return crypto_hash_digest(&desc, sg, size, result);
460 unsigned int crypto_tfm_alg_max_keysize(struct crypto_blkcipher *tfm)
462 return crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher.max_keysize;
465 unsigned int crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm)
467 return crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher.min_keysize;
470 #define ll_crypto_hash_blocksize(tfm) crypto_hash_blocksize(tfm)
471 #define ll_crypto_hash_digestsize(tfm) crypto_hash_digestsize(tfm)
472 #define ll_crypto_blkcipher_ivsize(tfm) crypto_blkcipher_ivsize(tfm)
473 #define ll_crypto_blkcipher_blocksize(tfm) crypto_blkcipher_blocksize(tfm)
474 #define ll_crypto_free_hash(tfm) crypto_free_hash(tfm)
475 #define ll_crypto_free_blkcipher(tfm) crypto_free_blkcipher(tfm)
476 #else /* HAVE_ASYNC_BLOCK_CIPHER */
477 #include <linux/scatterlist.h>
478 #define ll_crypto_hash crypto_tfm
479 #define ll_crypto_cipher crypto_tfm
481 struct ll_crypto_hash *tfm;
484 struct blkcipher_desc {
485 struct ll_crypto_cipher *tfm;
489 #define ll_crypto_blkcipher_setkey(tfm, key, keylen) \
490 crypto_cipher_setkey(tfm, key, keylen)
491 #define ll_crypto_blkcipher_set_iv(tfm, src, len) \
492 crypto_cipher_set_iv(tfm, src, len)
493 #define ll_crypto_blkcipher_get_iv(tfm, dst, len) \
494 crypto_cipher_get_iv(tfm, dst, len)
495 #define ll_crypto_blkcipher_encrypt(desc, dst, src, bytes) \
496 crypto_cipher_encrypt((desc)->tfm, dst, src, bytes)
497 #define ll_crypto_blkcipher_decrypt(desc, dst, src, bytes) \
498 crypto_cipher_decrypt((desc)->tfm, dst, src, bytes)
499 #define ll_crypto_blkcipher_decrypt_iv(desc, dst, src, bytes) \
500 crypto_cipher_decrypt_iv((desc)->tfm, dst, src, bytes, (desc)->info)
501 #define ll_crypto_blkcipher_encrypt_iv(desc, dst, src, bytes) \
502 crypto_cipher_encrypt_iv((desc)->tfm, dst, src, bytes, (desc)->info)
505 struct ll_crypto_cipher *ll_crypto_alloc_blkcipher(const char * algname,
508 char buf[CRYPTO_MAX_ALG_NAME + 1];
509 const char *pan = algname;
512 if (strncmp("cbc(", algname, 4) == 0)
513 flag |= CRYPTO_TFM_MODE_CBC;
514 else if (strncmp("ecb(", algname, 4) == 0)
515 flag |= CRYPTO_TFM_MODE_ECB;
517 char *vp = strnchr(algname, CRYPTO_MAX_ALG_NAME, ')');
519 memcpy(buf, algname + 4, vp - algname - 4);
520 buf[vp - algname - 4] = '\0';
526 return crypto_alloc_tfm(pan, flag);
530 struct ll_crypto_hash *ll_crypto_alloc_hash(const char *alg, u32 type, u32 mask)
532 char buf[CRYPTO_MAX_ALG_NAME + 1];
533 const char *pan = alg;
535 if (strncmp("hmac(", alg, 5) == 0) {
536 char *vp = strnchr(alg, CRYPTO_MAX_ALG_NAME, ')');
538 memcpy(buf, alg+ 5, vp - alg- 5);
539 buf[vp - alg - 5] = 0x00;
543 return crypto_alloc_tfm(pan, 0);
545 static inline int ll_crypto_hash_init(struct hash_desc *desc)
547 crypto_digest_init(desc->tfm); return 0;
549 static inline int ll_crypto_hash_update(struct hash_desc *desc,
550 struct scatterlist *sg,
553 struct scatterlist *sl = sg;
556 * This way is very weakness. We must ensure that
557 * the sum of sg[0..i]->length isn't greater than nbytes.
558 * In the upstream kernel the crypto_hash_update() also
559 * via the nbytes computed the count of sg[...].
560 * The old style is more safely. but it gone.
562 for (count = 0; nbytes > 0; count ++, sl ++) {
563 nbytes -= sl->length;
565 crypto_digest_update(desc->tfm, sg, count); return 0;
567 static inline int ll_crypto_hash_final(struct hash_desc *desc, u8 *out)
569 crypto_digest_final(desc->tfm, out); return 0;
571 static inline int ll_crypto_hmac(struct crypto_tfm *tfm,
572 u8 *key, unsigned int *keylen,
573 struct scatterlist *sg,
577 struct scatterlist *sl = sg;
579 for (count = 0; nbytes > 0; count ++, sl ++) {
580 nbytes -= sl->length;
582 crypto_hmac(tfm, key, keylen, sg, count, out);
586 #define ll_crypto_hash_setkey(tfm, key, keylen) crypto_digest_setkey(tfm, key, keylen)
587 #define ll_crypto_blkcipher_blocksize(tfm) crypto_tfm_alg_blocksize(tfm)
588 #define ll_crypto_blkcipher_ivsize(tfm) crypto_tfm_alg_ivsize(tfm)
589 #define ll_crypto_hash_digestsize(tfm) crypto_tfm_alg_digestsize(tfm)
590 #define ll_crypto_hash_blocksize(tfm) crypto_tfm_alg_blocksize(tfm)
591 #define ll_crypto_free_hash(tfm) crypto_free_tfm(tfm)
592 #define ll_crypto_free_blkcipher(tfm) crypto_free_tfm(tfm)
593 #endif /* HAVE_ASYNC_BLOCK_CIPHER */
595 #ifdef HAVE_SECURITY_PLUG
596 #define ll_remove_suid(inode,mnt) remove_suid(inode,mnt)
597 #define ll_vfs_rmdir(dir,entry,mnt) vfs_rmdir(dir,entry,mnt)
598 #define ll_vfs_mkdir(inode,dir,mnt,mode) vfs_mkdir(inode,dir,mnt,mode)
599 #define ll_vfs_link(old,mnt,dir,new,mnt1) vfs_link(old,mnt,dir,new,mnt1)
600 #define ll_vfs_unlink(inode,entry,mnt) vfs_unlink(inode,entry,mnt)
601 #define ll_vfs_mknod(dir,entry,mnt,mode,dev) \
602 vfs_mknod(dir,entry,mnt,mode,dev)
603 #define ll_security_inode_unlink(dir,entry,mnt) \
604 security_inode_unlink(dir,entry,mnt)
605 #define ll_vfs_rename(old,old_dir,mnt,new,new_dir,mnt1) \
606 vfs_rename(old,old_dir,mnt,new,new_dir,mnt1)
608 #define ll_remove_suid(inode,mnt) remove_suid(inode)
609 #define ll_vfs_rmdir(dir,entry,mnt) vfs_rmdir(dir,entry)
610 #define ll_vfs_mkdir(inode,dir,mnt,mode) vfs_mkdir(inode,dir,mode)
611 #define ll_vfs_link(old,mnt,dir,new,mnt1) vfs_link(old,dir,new)
612 #define ll_vfs_unlink(inode,entry,mnt) vfs_unlink(inode,entry)
613 #define ll_vfs_mknod(dir,entry,mnt,mode,dev) vfs_mknod(dir,entry,mode,dev)
614 #define ll_security_inode_unlink(dir,entry,mnt) security_inode_unlink(dir,entry)
615 #define ll_vfs_rename(old,old_dir,mnt,new,new_dir,mnt1) \
616 vfs_rename(old,old_dir,new,new_dir)
620 #ifdef CONFIG_PREEMPT
621 #define get_cpu() ({ preempt_disable(); smp_processor_id(); })
622 #define put_cpu() preempt_enable()
624 #define get_cpu() smp_processor_id()
627 #endif /* get_cpu & put_cpu */
629 #ifndef for_each_possible_cpu
630 #define for_each_possible_cpu(i) for_each_cpu(i)
634 #define cpu_to_node(cpu) 0
638 static inline int abs(int x)
640 return (x < 0) ? -x : x;
645 static inline long labs(long x)
647 return (x < 0) ? -x : x;
651 /* Using kernel fls(). Userspace will use one defined in user-bitops.h. */
656 #ifdef HAVE_INVALIDATE_INODE_PAGES
657 #define invalidate_mapping_pages(mapping,s,e) invalidate_inode_pages(mapping)
660 #endif /* __KERNEL__ */
661 #endif /* _COMPAT25_H */