vfsmod.h revision 13fdd42f1fc3e519650037a920e6a54c24973866
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync/** @file
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync *
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * vboxvfs -- VirtualBox Guest Additions for Linux
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync */
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync/*
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * Copyright (C) 2006 InnoTek Systemberatung GmbH
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync *
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * available from http://www.virtualbox.org. This file is free software;
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * you can redistribute it and/or modify it under the terms of the GNU
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * General Public License as published by the Free Software Foundation,
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync *
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * If you received this file as part of a commercial VirtualBox
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * distribution, then only the terms of your commercial VirtualBox
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync * license agreement apply instead of the previous paragraph.
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync */
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#ifndef VFSMOD_H
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define VFSMOD_H
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define elog(fmt, ...) \
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsyncprintk (KERN_ERR "vboxvfs: %s: " fmt, __func__, __VA_ARGS__)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define elog2(s) printk (KERN_ERR "vboxvfs: %s: " s, __func__)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define elog3(...) printk (KERN_ERR "vboxvfs: " __VA_ARGS__)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#ifdef ALIGN
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#undef ALIGN
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#endif
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define CMC_API __attribute__ ((cdecl, regparm (0)))
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define DBGC if (0)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define TRACE() DBGC printk (KERN_DEBUG "%s\n", __func__)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync/* Following casts are here to prevent assignment of void * to
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync pointers of arbitrary type */
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 0)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define GET_GLOB_INFO(sb) ((struct sf_glob_info *) (sb)->u.generic_sbp)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define SET_GLOB_INFO(sb, sf_g) (sb)->u.generic_sbp = sf_g
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync#else
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define GET_GLOB_INFO(sb) ((struct sf_glob_info *) (sb)->s_fs_info)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define SET_GLOB_INFO(sb, sf_g) (sb)->s_fs_info = sf_g
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#endif
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) || defined(KERNEL_FC6)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync/* FC6 kernel 2.6.18, vanilla kernel 2.6.19+ */
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define GET_INODE_INFO(i) ((struct sf_inode_info *) (i)->i_private)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define SET_INODE_INFO(i, sf_i) (i)->i_private = sf_i
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#else
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync/* vanilla kernel up to 2.6.18 */
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define GET_INODE_INFO(i) ((struct sf_inode_info *) (i)->u.generic_ip)
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#define SET_INODE_INFO(i, sf_i) (i)->u.generic_ip = sf_i
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#endif
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync#endif /* vfsmod.h */
d84b6107a8e797f41ac2d55bed97b02c91c742e8vboxsync