} 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)
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)