])
])
-AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
+AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE],
[LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
[mm/truncate.c],[
AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
CFLAGS="$tmpfl"
])
+# 2.6.5 sles9 hasn't define sysctl_vfs_cache_pressure
+AC_DEFUN([LC_HAVE_SYSCTL_VFS_CACHE_PRESSURE],
+[LB_CHECK_SYMBOL_EXPORT([sysctl_vfs_cache_pressure],
+[fs/dcache.c],[
+ AC_DEFINE(HAVE_SYSCTL_VFS_CACHE_PRESSURE, 1, [kernel exports sysctl_vfs_cache_pressure])
+],[
+])
+])
+
#
# LC_PROG_LINUX
#
LC_TASK_PPTR
# RHEL4 patches
- LC_EXPORT_TRUNCATE_COMPLETE
+ LC_EXPORT_TRUNCATE_COMPLETE_PAGE
LC_EXPORT_TRUNCATE_RANGE
LC_EXPORT_D_REHASH_COND
LC_EXPORT___D_REHASH
# does the kernel have VFS intent patches?
LC_VFS_INTENT_PATCHES
+ # 2.6.5 sles9
+ LC_HAVE_SYSCTL_VFS_CACHE_PRESSURE
+
# 2.6.12
LC_RW_TREE_LOCK
struct niobuf_remote *nb, int pages,
struct niobuf_local *res, struct inode *inode)
{
- struct niobuf_remote *rnb;
int i;
LASSERT(inode != NULL);
#ifdef HAVE_TRUNCATE_RANGE
- for (i = 0, rnb = nb; i < obj->ioo_bufcnt; i++, rnb++) {
+ for (i = 0; i < obj->ioo_bufcnt; i++, nb++) {
/* remove pages in which range is fit */
truncate_inode_pages_range(inode->i_mapping,
- rnb->offset & CFS_PAGE_MASK,
- (rnb->offset + rnb->len - 1) |
+ nb->offset & CFS_PAGE_MASK,
+ (nb->offset + nb->len - 1) |
~CFS_PAGE_MASK);
}
-#elif (defined HAVE_TRUNCATE_COMPLETE)
- for (i = 0, lnb = res; i < pages; i++, lnb++)
- truncate_complete_page(inode->i_mapping, lnb->page);
+#elif (defined HAVE_TRUNCATE_COMPLETE_PAGE)
+ for (i = 0; i < pages; i++, res++) {
+ if (res->page != NULL)
+ truncate_complete_page(inode->i_mapping, res->page);
+ }
#else
#error "Nor truncate_inode_pages_range or truncate_complete_page are supported"
#endif