From b831b8c15b8cc00af0ac42477032f22ccd2dbc45 Mon Sep 17 00:00:00 2001 From: jacob Date: Sat, 11 Jun 2005 15:47:54 +0000 Subject: [PATCH] From last week at CGG: filemap_fdatawrite is present in vanilla 2.4.29, add configure check --- lustre/autoconf/lustre-core.m4 | 20 ++++++++++++++++++++ lustre/include/linux/lustre_compat25.h | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 6156424..a47df45 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -155,6 +155,25 @@ fi ]) # +# LC_FUNC_FILEMAP_FDATASYNC +# +# if filemap_fdatasync() exists +# +AC_DEFUN([LC_FUNC_FILEMAP_FDATAWRITE], +[AC_MSG_CHECKING([whether filemap_fdatawrite() is defined]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + int (*foo)(struct address_space *)= filemap_fdatawrite; +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_FILEMAP_FDATAWRITE, 1, [filemap_fdatawrite() found]) +],[ + AC_MSG_RESULT([no]) +]) +]) + +# # LC_FUNC_DIRECT_IO # # if direct_IO takes a struct file argument @@ -404,6 +423,7 @@ LC_STRUCT_INODE LC_FUNC_REGISTER_CACHE LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP LC_FUNC_DEV_SET_RDONLY +LC_FUNC_FILEMAP_FDATAWRITE ]) # diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 3007c0f..0783be1 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -166,7 +166,6 @@ typedef long sector_t; #define ll_pgcache_unlock(mapping) spin_unlock(&pagecache_lock) #define ll_call_writepage(inode, page) \ (inode)->i_mapping->a_ops->writepage(page) -#define filemap_fdatawrite(mapping) filemap_fdatasync(mapping) #define ll_invalidate_inode_pages(inode) invalidate_inode_pages(inode) #define ll_truncate_complete_page(page) truncate_complete_page(page) @@ -324,5 +323,9 @@ static inline int mapping_has_pages(struct address_space *mapping) #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 + #endif /* __KERNEL__ */ #endif /* _COMPAT25_H */ -- 1.8.3.1