[PATCH] xfs: use smaller int param in call to xfs_flush_pages

From: Denys Vlasenko
Date: Mon Apr 21 2008 - 23:15:46 EST


Hi David,

xfs_flush_pages() flags parameter is declared as uint64_t, but
code never pass values which do not fit into 32 bits.
All callsites sans one pass zero, and the last one passes
XFS_B_DELWRI, XFS_B_ASYNC or zero.
These values are defined in enum xfs_buf_flags_t and they
all fit in 32 bits.

This patch changes type of the parameter and one variable
which used to pass it to unsigned int.

Code size difference on 32-bit x86:

# size */fs/xfs/xfs.o
text data bss dec hex filename
390567 2748 1708 395023 6070f linux-2.6-xfs2-TEST/fs/xfs/xfs.o
390507 2748 1708 394963 606d3 linux-2.6-xfs3-TEST/fs/xfs/xfs.o

Compile-tested only.

Signed-off-by: Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>
--
vda
--- linux-2.6-xfs2/fs/xfs/linux-2.6/xfs_fs_subr.c Tue Apr 22 04:46:33 2008
+++ linux-2.6-xfs3/fs/xfs/linux-2.6/xfs_fs_subr.c Tue Apr 22 05:05:47 2008
@@ -72,7 +72,7 @@
int
xfs_flush_pages(
xfs_inode_t *ip,
- uint64_t flags)
+ unsigned int flags)
{
bhv_vnode_t *vp = XFS_ITOV(ip);
struct inode *inode = vn_to_inode(vp);
--- linux-2.6-xfs2/fs/xfs/xfs_vfsops.c Tue Apr 22 04:47:36 2008
+++ linux-2.6-xfs3/fs/xfs/xfs_vfsops.c Tue Apr 22 05:05:17 2008
@@ -897,7 +897,7 @@
bhv_vnode_t *vp = NULL;
int error;
int last_error;
- uint64_t fflag;
+ unsigned int fflag;
uint lock_flags;
uint base_lock_flags;
boolean_t mount_locked;
--- linux-2.6-xfs2/fs/xfs/xfs_vnodeops.h Tue Apr 22 04:46:59 2008
+++ linux-2.6-xfs3/fs/xfs/xfs_vnodeops.h Tue Apr 22 05:04:52 2008
@@ -78,6 +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, uint64_t flags);
+int xfs_flush_pages(struct xfs_inode *ip, unsigned int flags);

#endif /* _XFS_VNODEOPS_H */