From 891456227881da9c565c455010380a40d385a478 Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Wed, 13 Feb 2008 15:34:20 -0600 Subject: jfs: le*_add_cpu conversion replace all: little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) + expression_in_cpu_byteorder); with: leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder); generated with semantic patch Signed-off-by: Marcin Slusarz Signed-off-by: Dave Kleikamp Cc: jfs-discussion@lists.sourceforge.net --- fs/jfs/jfs_imap.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'fs/jfs/jfs_imap.c') diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 9bf29f77173..734ec916bea 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -1019,8 +1019,7 @@ int diFree(struct inode *ip) /* update the free inode counts at the iag, ag and * map level. */ - iagp->nfreeinos = - cpu_to_le32(le32_to_cpu(iagp->nfreeinos) + 1); + le32_add_cpu(&iagp->nfreeinos, 1); imap->im_agctl[agno].numfree += 1; atomic_inc(&imap->im_numfree); @@ -1219,9 +1218,8 @@ int diFree(struct inode *ip) /* update the number of free inodes and number of free extents * for the iag. */ - iagp->nfreeinos = cpu_to_le32(le32_to_cpu(iagp->nfreeinos) - - (INOSPEREXT - 1)); - iagp->nfreeexts = cpu_to_le32(le32_to_cpu(iagp->nfreeexts) + 1); + le32_add_cpu(&iagp->nfreeinos, -(INOSPEREXT - 1)); + le32_add_cpu(&iagp->nfreeexts, 1); /* update the number of free inodes and backed inodes * at the ag and inode map level. @@ -2124,7 +2122,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino) /* update the free inode count at the iag, ag, inode * map levels. */ - iagp->nfreeinos = cpu_to_le32(le32_to_cpu(iagp->nfreeinos) - 1); + le32_add_cpu(&iagp->nfreeinos, -1); imap->im_agctl[agno].numfree -= 1; atomic_dec(&imap->im_numfree); @@ -2378,9 +2376,8 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno) /* update the free inode and free extent counts for the * iag. */ - iagp->nfreeinos = cpu_to_le32(le32_to_cpu(iagp->nfreeinos) + - (INOSPEREXT - 1)); - iagp->nfreeexts = cpu_to_le32(le32_to_cpu(iagp->nfreeexts) - 1); + le32_add_cpu(&iagp->nfreeinos, (INOSPEREXT - 1)); + le32_add_cpu(&iagp->nfreeexts, -1); /* update the free and backed inode counts for the ag. */ -- cgit v1.2.3