From: Jeff Mahoney <jeffm@suse.com>
Subject: xfs-dmapi: 2.6.34 API changes
Patch-mainline: Never

 2.6.34-rc1 changed some XFS APIs. This patch updates them.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/xfs/dmapi/xfs_dm.c       |    4 ++--
 fs/xfs/linux-2.6/xfs_file.c |   23 +++++++++++++++--------
 fs/xfs/linux-2.6/xfs_iops.h |    3 +++
 3 files changed, 20 insertions(+), 10 deletions(-)

--- a/fs/xfs/dmapi/xfs_dm.c
+++ b/fs/xfs/dmapi/xfs_dm.c
@@ -1956,7 +1956,7 @@ xfs_dm_get_dmattr(
 		alloc_size = XFS_BUG_KLUDGE;
 	if (alloc_size > ATTR_MAX_VALUELEN)
 		alloc_size = ATTR_MAX_VALUELEN;
-	value = kmem_alloc(alloc_size, KM_SLEEP | KM_LARGE);
+	value = kmem_zalloc_large(alloc_size);
 
 	/* Get the attribute's value. */
 
@@ -2877,7 +2877,7 @@ xfs_dm_sync_by_handle(
 	/* We need to protect against concurrent writers.. */
 	ret = filemap_fdatawrite(inode->i_mapping);
 	down_rw_sems(inode, DM_FLAGS_IMUX);
-	err = -xfs_fsync(ip);
+	err = xfs_fsync(inode, 1);
 	if (!ret)
 		ret = err;
 	up_rw_sems(inode, DM_FLAGS_IMUX);
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -100,13 +100,10 @@ xfs_iozero(
 	return (-status);
 }
 
-STATIC int
-xfs_file_fsync(
-	struct file		*file,
-	struct dentry		*dentry,
-	int			datasync)
+int
+xfs_fsync(struct inode *inode, int datasync)
 {
-	struct xfs_inode	*ip = XFS_I(dentry->d_inode);
+	struct xfs_inode	*ip = XFS_I(inode);
 	struct xfs_trans	*tp;
 	int			error = 0;
 	int			log_flushed = 0;
@@ -141,8 +138,8 @@ xfs_file_fsync(
 	 * might gets cleared when the inode gets written out via the AIL
 	 * or xfs_iflush_cluster.
 	 */
-	if (((dentry->d_inode->i_state & I_DIRTY_DATASYNC) ||
-	    ((dentry->d_inode->i_state & I_DIRTY_SYNC) && !datasync)) &&
+	if (((inode->i_state & I_DIRTY_DATASYNC) ||
+	    ((inode->i_state & I_DIRTY_SYNC) && !datasync)) &&
 	    ip->i_update_core) {
 		/*
 		 * Kick off a transaction to log the inode core to get the
@@ -210,6 +207,16 @@ xfs_file_fsync(
 	return -error;
 }
 
+STATIC int
+xfs_file_fsync(
+	struct file		*file,
+	struct dentry		*dentry,
+	int			datasync)
+{
+	return xfs_fsync(dentry->d_inode, datasync);
+}
+
+
 STATIC ssize_t
 xfs_file_aio_read(
 	struct kiocb		*iocb,
--- a/fs/xfs/linux-2.6/xfs_iops.h
+++ b/fs/xfs/linux-2.6/xfs_iops.h
@@ -27,4 +27,7 @@ extern ssize_t xfs_vn_listxattr(struct d
 
 extern void xfs_setup_inode(struct xfs_inode *);
 
+extern int xfs_fsync(struct inode *, int);
+
 #endif /* __XFS_IOPS_H__ */
+
