#error sorry, lustre requires at least 2.5.69
#endif
-#include <linux/portals_compat25.h>
+#include <libcfs/linux/portals_compat25.h>
/*
* groups_info related staff
} while (0)
#define groups_sort(gi) do {} while (0)
-
#define GROUP_AT(gi, i) ((gi)->small_block[(i)])
static inline int cleanup_group_info(void)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+/* New (actually old) intent naming */
+#define lookup_intent open_intent
+
+/* And internals */
+#define it_flags flags
+#define it_op op
+#define it_magic magic
+#define it_op_release op_release
+#define it_create_mode create_mode
+
/*
* OBD need working random driver, thus all our
* initialization routines must be called after device
page->private = 0; \
} while(0)
+#ifndef smp_num_cpus
+#define smp_num_cpus num_online_cpus()
+#endif
+
#define kiobuf bio
#include <linux/proc_fs.h>
static inline int mapping_mapped(struct address_space *mapping)
{
- return mapping->i_mmap_shared ? 1 : 0;
+ if (mapping->i_mmap_shared)
+ return 1;
+ if (mapping->i_mmap)
+ return 1;
+ return 0;
}
/* to find proc_dir_entry from inode. 2.6 has native one -bzzz */
#define ll_vfs_symlink(dir, dentry, path, mode) vfs_symlink(dir, dentry, path, mode)
#endif
+#ifndef container_of
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+#endif
+
#ifdef HAVE_I_ALLOC_SEM
#define UP_WRITE_I_ALLOC_SEM(i) do { up_write(&(i)->i_alloc_sem); } while (0)
#define DOWN_WRITE_I_ALLOC_SEM(i) do { down_write(&(i)->i_alloc_sem); } while(0)