truncate_pagecache doesn't need oldsize parameter anymore.
In fact, the oldsize useless in all kernel we supported. so
just remove all things relate to it.
Signed-off-by: yang sheng <yang.sheng@intel.com>
Change-Id: Iba9ccebb73e7e8df3179ef1d68507b7403b117a7
Reviewed-on: http://review.whamcloud.com/8800
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+# 3.12 truncate_pagecache without oldsize parameter
+#
+AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE],
+[AC_MSG_CHECKING([if truncate_pagecache with old_size parameter])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/mm.h>
+],[
+ truncate_pagecache(NULL, 0, 0);
+],[
+ AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1, [with oldsize])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# LC_PROG_LINUX
#
# Lustre linux kernel checks
LC_D_COMPARE_5ARGS
LC_HAVE_DCOUNT
LC_D_COMPARE_5ARGS
LC_HAVE_DCOUNT
+ # 3.12
+ LC_OLDSIZE_TRUNCATE_PAGECACHE
+
#
if test x$enable_server != xno ; then
LC_FUNC_DEV_SET_RDONLY
#
if test x$enable_server != xno ; then
LC_FUNC_DEV_SET_RDONLY
# define set_file_inode(file, inode)
#endif
# define set_file_inode(file, inode)
#endif
+#ifdef HAVE_OLDSIZE_TRUNCATE_PAGECACHE
+#define ll_truncate_pagecache(inode, size) truncate_pagecache(inode, 0, size)
+#else
+#define ll_truncate_pagecache(inode, size) truncate_pagecache(inode, size)
+#endif
+
static int vvp_do_vmtruncate(struct inode *inode, size_t size)
{
int result;
static int vvp_do_vmtruncate(struct inode *inode, size_t size)
{
int result;
/*
* Only ll_inode_size_lock is taken at this level.
/*
* Only ll_inode_size_lock is taken at this level.
ll_inode_size_unlock(inode);
return result;
}
ll_inode_size_unlock(inode);
return result;
}
- oldsize = inode->i_size;
i_size_write(inode, size);
i_size_write(inode, size);
- truncate_pagecache(inode, oldsize, size);
+ ll_truncate_pagecache(inode, size);
ll_inode_size_unlock(inode);
return result;
}
ll_inode_size_unlock(inode);
return result;
}
struct inode *inode = obj->oo_inode;
handle_t *h;
tid_t tid;
struct inode *inode = obj->oo_inode;
handle_t *h;
tid_t tid;
int rc = 0, rc2 = 0;
ENTRY;
int rc = 0, rc2 = 0;
ENTRY;
tid = oh->ot_handle->h_transaction->t_tid;
tid = oh->ot_handle->h_transaction->t_tid;
i_size_write(inode, start);
i_size_write(inode, start);
- truncate_pagecache(inode, oldsize, start);
+ ll_truncate_pagecache(inode, start);
#ifdef HAVE_INODEOPS_TRUNCATE
if (inode->i_op->truncate)
inode->i_op->truncate(inode);
#ifdef HAVE_INODEOPS_TRUNCATE
if (inode->i_op->truncate)
inode->i_op->truncate(inode);