aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2008-03-05 21:43:59 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:37:51 -0400
commit3354040897f828644be6ca5783588e9f64a53b8e (patch)
treec41cfb4584e13225b1f4578e64c8739d88a8537c /fs/xfs/xfs_inode.c
parentbad5584332e888ac40ca13584e8c114149ddb01e (diff)
[XFS] Use xfs_inode_clean() in more places
Remove open coded checks for the whether the inode is clean and replace them with an inlined function. SGI-PV: 977461 SGI-Modid: xfs-linux-melb:xfs-kern:30503a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 040c0e41729b..d7514f8317df 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2118,13 +2118,6 @@ xfs_iunlink_remove(
2118 return 0; 2118 return 0;
2119} 2119}
2120 2120
2121STATIC_INLINE int xfs_inode_clean(xfs_inode_t *ip)
2122{
2123 return (((ip->i_itemp == NULL) ||
2124 !(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL)) &&
2125 (ip->i_update_core == 0));
2126}
2127
2128STATIC void 2121STATIC void
2129xfs_ifree_cluster( 2122xfs_ifree_cluster(
2130 xfs_inode_t *free_ip, 2123 xfs_inode_t *free_ip,
@@ -3004,7 +2997,6 @@ xfs_iflush_cluster(
3004 int ilist_size; 2997 int ilist_size;
3005 xfs_inode_t **ilist; 2998 xfs_inode_t **ilist;
3006 xfs_inode_t *iq; 2999 xfs_inode_t *iq;
3007 xfs_inode_log_item_t *iip;
3008 int nr_found; 3000 int nr_found;
3009 int clcount = 0; 3001 int clcount = 0;
3010 int bufwasdelwri; 3002 int bufwasdelwri;
@@ -3040,13 +3032,8 @@ xfs_iflush_cluster(
3040 * is a candidate for flushing. These checks will be repeated 3032 * is a candidate for flushing. These checks will be repeated
3041 * later after the appropriate locks are acquired. 3033 * later after the appropriate locks are acquired.
3042 */ 3034 */
3043 iip = iq->i_itemp; 3035 if (xfs_inode_clean(iq) && xfs_ipincount(iq) == 0)
3044 if ((iq->i_update_core == 0) &&
3045 ((iip == NULL) ||
3046 !(iip->ili_format.ilf_fields & XFS_ILOG_ALL)) &&
3047 xfs_ipincount(iq) == 0) {
3048 continue; 3036 continue;
3049 }
3050 3037
3051 /* 3038 /*
3052 * Try to get locks. If any are unavailable or it is pinned, 3039 * Try to get locks. If any are unavailable or it is pinned,
@@ -3069,10 +3056,8 @@ xfs_iflush_cluster(
3069 * arriving here means that this inode can be flushed. First 3056 * arriving here means that this inode can be flushed. First
3070 * re-check that it's dirty before flushing. 3057 * re-check that it's dirty before flushing.
3071 */ 3058 */
3072 iip = iq->i_itemp; 3059 if (!xfs_inode_clean(iq)) {
3073 if ((iq->i_update_core != 0) || ((iip != NULL) && 3060 int error;
3074 (iip->ili_format.ilf_fields & XFS_ILOG_ALL))) {
3075 int error;
3076 error = xfs_iflush_int(iq, bp); 3061 error = xfs_iflush_int(iq, bp);
3077 if (error) { 3062 if (error) {
3078 xfs_iunlock(iq, XFS_ILOCK_SHARED); 3063 xfs_iunlock(iq, XFS_ILOCK_SHARED);
@@ -3176,8 +3161,7 @@ xfs_iflush(
3176 * If the inode isn't dirty, then just release the inode 3161 * If the inode isn't dirty, then just release the inode
3177 * flush lock and do nothing. 3162 * flush lock and do nothing.
3178 */ 3163 */
3179 if ((ip->i_update_core == 0) && 3164 if (xfs_inode_clean(ip)) {
3180 ((iip == NULL) || !(iip->ili_format.ilf_fields & XFS_ILOG_ALL))) {
3181 ASSERT((iip != NULL) ? 3165 ASSERT((iip != NULL) ?
3182 !(iip->ili_item.li_flags & XFS_LI_IN_AIL) : 1); 3166 !(iip->ili_item.li_flags & XFS_LI_IN_AIL) : 1);
3183 xfs_ifunlock(ip); 3167 xfs_ifunlock(ip);
@@ -3343,8 +3327,7 @@ xfs_iflush_int(
3343 * If the inode isn't dirty, then just release the inode 3327 * If the inode isn't dirty, then just release the inode
3344 * flush lock and do nothing. 3328 * flush lock and do nothing.
3345 */ 3329 */
3346 if ((ip->i_update_core == 0) && 3330 if (xfs_inode_clean(ip)) {
3347 ((iip == NULL) || !(iip->ili_format.ilf_fields & XFS_ILOG_ALL))) {
3348 xfs_ifunlock(ip); 3331 xfs_ifunlock(ip);
3349 return 0; 3332 return 0;
3350 } 3333 }