[PATCH] xfs: do not pass unused params to xfs_flush_pages

From: Denys Vlasenko
Date: Mon Apr 21 2008 - 23:04:14 EST


Hi David,

xfs_flush_pages() does not use some of its parameters, namely:
first, last and fiops.

This patch removes these parameters from all callsites.

Code size difference on 32-bit x86:

text data bss dec hex filename
390739 2748 1708 395195 607bb linux-2.6-xfs1-TEST/fs/xfs/xfs.o
390567 2748 1708 395023 6070f linux-2.6-xfs2-TEST/fs/xfs/xfs.o

Compile-tested only.

Signed-off-by: Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>
--
vda
--- linux-2.6-xfs1/fs/xfs/linux-2.6/xfs_aops.c Tue Apr 22 04:06:46 2008
+++ linux-2.6-xfs2/fs/xfs/linux-2.6/xfs_aops.c Tue Apr 22 04:46:49 2008
@@ -1533,7 +1532,7 @@

xfs_itrace_entry(XFS_I(inode));
xfs_rwlock(ip, VRWLOCK_READ);
- xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
+ xfs_flush_pages(ip, 0);
xfs_rwunlock(ip, VRWLOCK_READ);
return generic_block_bmap(mapping, block, xfs_get_blocks);
}
--- linux-2.6-xfs1/fs/xfs/linux-2.6/xfs_fs_subr.c Tue Apr 22 04:06:46 2008
+++ linux-2.6-xfs2/fs/xfs/linux-2.6/xfs_fs_subr.c Tue Apr 22 04:46:33 2008
@@ -72,10 +72,7 @@
int
xfs_flush_pages(
xfs_inode_t *ip,
- xfs_off_t first,
- xfs_off_t last,
- uint64_t flags,
- int fiopt)
+ uint64_t flags)
{
bhv_vnode_t *vp = XFS_ITOV(ip);
struct inode *inode = vn_to_inode(vp);
--- linux-2.6-xfs1/fs/xfs/xfs_bmap.c Tue Apr 22 04:16:25 2008
+++ linux-2.6-xfs2/fs/xfs/xfs_bmap.c Tue Apr 22 04:47:22 2008
@@ -5867,8 +5867,7 @@
if (whichfork == XFS_DATA_FORK &&
(ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) {
/* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */
- error = xfs_flush_pages(ip, (xfs_off_t)0,
- -1, 0, FI_REMAPF);
+ error = xfs_flush_pages(ip, 0);
}

ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0);
--- linux-2.6-xfs1/fs/xfs/xfs_vfsops.c Tue Apr 22 04:18:53 2008
+++ linux-2.6-xfs2/fs/xfs/xfs_vfsops.c Tue Apr 22 04:47:36 2008
@@ -1121,8 +1121,7 @@
error = xfs_flushinval_pages(ip,
0, -1, FI_REMAPF);
} else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) {
- error = xfs_flush_pages(ip, 0,
- -1, fflag, FI_NONE);
+ error = xfs_flush_pages(ip, fflag);
}

/*
--- linux-2.6-xfs1/fs/xfs/xfs_vnodeops.c Tue Apr 22 04:06:44 2008
+++ linux-2.6-xfs2/fs/xfs/xfs_vnodeops.c Tue Apr 22 04:47:13 2008
@@ -592,9 +592,7 @@
if (!code &&
(ip->i_size != ip->i_d.di_size) &&
(vap->va_size > ip->i_d.di_size)) {
- code = xfs_flush_pages(ip,
- ip->i_d.di_size, vap->va_size,
- XFS_B_ASYNC, FI_NONE);
+ code = xfs_flush_pages(ip, XFS_B_ASYNC);
}

/* wait for all I/O to complete */
@@ -1517,7 +1515,7 @@
*/
truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED);
if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0)
- xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE);
+ xfs_flush_pages(ip, XFS_B_ASYNC);
}

#ifdef HAVE_REFCACHE
--- linux-2.6-xfs1/fs/xfs/xfs_vnodeops.h Tue Apr 22 04:06:44 2008
+++ linux-2.6-xfs2/fs/xfs/xfs_vnodeops.h Tue Apr 22 04:46:59 2008
@@ -78,7 +78,6 @@
xfs_off_t last, int fiopt);
int xfs_flushinval_pages(struct xfs_inode *ip, xfs_off_t first,
xfs_off_t last, int fiopt);
-int xfs_flush_pages(struct xfs_inode *ip, xfs_off_t first,
- xfs_off_t last, uint64_t flags, int fiopt);
+int xfs_flush_pages(struct xfs_inode *ip, uint64_t flags);

#endif /* _XFS_VNODEOPS_H */