(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)
+#define UP_WRITE_I_ALLOC_SEM(i) up_write(&(i)->i_alloc_sem)
+#define DOWN_WRITE_I_ALLOC_SEM(i) down_write(&(i)->i_alloc_sem)
#define LASSERT_I_ALLOC_SEM_WRITE_LOCKED(i) LASSERT(down_read_trylock(&(i)->i_alloc_sem) == 0)
-#define UP_READ_I_ALLOC_SEM(i) do { up_read(&(i)->i_alloc_sem); } while (0)
-#define DOWN_READ_I_ALLOC_SEM(i) do { down_read(&(i)->i_alloc_sem); } while (0)
+#define UP_READ_I_ALLOC_SEM(i) up_read(&(i)->i_alloc_sem)
+#define DOWN_READ_I_ALLOC_SEM(i) down_read(&(i)->i_alloc_sem)
#define LASSERT_I_ALLOC_SEM_READ_LOCKED(i) LASSERT(down_write_trylock(&(i)->i_alloc_sem) == 0)
-#else
-#define UP_READ_I_ALLOC_SEM(i) do { } while (0)
-#define DOWN_READ_I_ALLOC_SEM(i) do { } while (0)
-#define LASSERT_I_ALLOC_SEM_READ_LOCKED(i) do { } while (0)
-
-#define UP_WRITE_I_ALLOC_SEM(i) do { } while (0)
-#define DOWN_WRITE_I_ALLOC_SEM(i) do { } while (0)
-#define LASSERT_I_ALLOC_SEM_WRITE_LOCKED(i) do { } while (0)
-#endif
#ifndef HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP
#define grab_cache_page_nowait_gfp(x, y, z) grab_cache_page_nowait((x), (y))
#endif
-#ifndef HAVE_FILEMAP_FDATAWRITE
-#define filemap_fdatawrite(mapping) filemap_fdatasync(mapping)
-#endif
-
#include <linux/mpage.h> /* for generic_writepages */
#ifndef HAVE_FILEMAP_FDATAWRITE_RANGE
#include <linux/backing-dev.h> /* for mapping->backing_dev_info */
#else
int filemap_fdatawrite_range(struct address_space *mapping,
loff_t start, loff_t end);
-#endif
+#endif /* HAVE_FILEMAP_FDATAWRITE_RANGE */
#ifdef HAVE_VFS_KERN_MOUNT
-static inline
-struct vfsmount *
+static inline struct vfsmount *
ll_kern_mount(const char *fstype, int flags, const char *name, void *data)
{
struct file_system_type *type = get_fs_type(fstype);
#define ll_do_statfs(sb, sfs) (sb)->s_op->statfs((sb), (sfs))
#endif
-/* task_struct */
-#ifndef HAVE_TASK_PPTR
-#define p_pptr parent
-#endif
-
#ifndef HAVE_SB_TIME_GRAN
#ifndef HAVE_S_TIME_GRAN
#error Need s_time_gran patch!
#define ll_security_inode_unlink(dir,entry,mnt) security_inode_unlink(dir,entry)
#define ll_vfs_rename(old,old_dir,mnt,new,new_dir,mnt1) \
vfs_rename(old,old_dir,new,new_dir)
-#endif
+#endif /* HAVE_SECURITY_PLUG */
#ifndef for_each_possible_cpu
#define for_each_possible_cpu(i) for_each_cpu(i)
{
return (x < 0) ? -x : x;
}
-#endif
+#endif /* HAVE_REGISTER_SHRINKER */
/* Using kernel fls(). Userspace will use one defined in user-bitops.h. */
#ifndef __fls