}
 
        /* update the free count for this dmap */
-       dp->nfree = cpu_to_le32(le32_to_cpu(dp->nfree) - nblocks);
+       le32_add_cpu(&dp->nfree, -nblocks);
 
        BMAP_LOCK(bmp);
 
 
        /* update the free count for this dmap.
         */
-       dp->nfree = cpu_to_le32(le32_to_cpu(dp->nfree) + nblocks);
+       le32_add_cpu(&dp->nfree, nblocks);
 
        BMAP_LOCK(bmp);
 
        }
 
        /* update the free count for this dmap */
-       dp->nfree = cpu_to_le32(le32_to_cpu(dp->nfree) - nblocks);
+       le32_add_cpu(&dp->nfree, -nblocks);
 
        /* reconstruct summary tree */
        dbInitDmapTree(dp);
                        goto initTree;
                }
        } else {
-               dp->nblocks =
-                   cpu_to_le32(le32_to_cpu(dp->nblocks) + nblocks);
-               dp->nfree = cpu_to_le32(le32_to_cpu(dp->nfree) + nblocks);
+               le32_add_cpu(&dp->nblocks, nblocks);
+               le32_add_cpu(&dp->nfree, nblocks);
        }
 
        /* word number containing start block number */
 
                /* 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);
 
        /* 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.
        /* 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);
 
        /* 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.
         */
 
        XT_PUTENTRY(xad, xflag, xoff, xlen, xaddr);
 
        /* advance next available entry index */
-       p->header.nextindex =
-           cpu_to_le16(le16_to_cpu(p->header.nextindex) + 1);
+       le16_add_cpu(&p->header.nextindex, 1);
 
        /* Don't log it if there are no links to the file */
        if (!test_cflag(COMMIT_Nolink, ip)) {
                            split->addr);
 
                /* advance next available entry index */
-               sp->header.nextindex =
-                   cpu_to_le16(le16_to_cpu(sp->header.nextindex) + 1);
+               le16_add_cpu(&sp->header.nextindex, 1);
 
                /* Don't log it if there are no links to the file */
                if (!test_cflag(COMMIT_Nolink, ip)) {
                                    JFS_SBI(ip->i_sb)->nbperpage, rcbn);
 
                        /* advance next available entry index. */
-                       sp->header.nextindex =
-                           cpu_to_le16(le16_to_cpu(sp->header.nextindex) +
-                                       1);
+                       le16_add_cpu(&sp->header.nextindex, 1);
 
                        /* Don't log it if there are no links to the file */
                        if (!test_cflag(COMMIT_Nolink, ip)) {
                XT_PUTENTRY(xad, XAD_NEW, xoff, len, xaddr);
 
                /* advance next available entry index */
-               p->header.nextindex =
-                   cpu_to_le16(le16_to_cpu(p->header.nextindex) + 1);
+               le16_add_cpu(&p->header.nextindex, 1);
        }
 
        /* get back old entry */
                XT_PUTENTRY(xad, XAD_NEW, xoff, xlen, xaddr);
 
                /* advance next available entry index */
-               p->header.nextindex =
-                   cpu_to_le16(le16_to_cpu(p->header.nextindex) + 1);
+               le16_add_cpu(&p->header.nextindex, 1);
        }
 
        /* get back old XAD */
        XT_PUTENTRY(xad, xflag, xoff, xlen, xaddr);
 
        /* advance next available entry index */
-       p->header.nextindex =
-           cpu_to_le16(le16_to_cpu(p->header.nextindex) + 1);
+       le16_add_cpu(&p->header.nextindex, 1);
 
        xtlck->lwm.offset =
            (xtlck->lwm.offset) ? min(index,(int) xtlck->lwm.offset) : index;
         * delete the entry from the leaf page
         */
        nextindex = le16_to_cpu(p->header.nextindex);
-       p->header.nextindex =
-           cpu_to_le16(le16_to_cpu(p->header.nextindex) - 1);
+       le16_add_cpu(&p->header.nextindex, -1);
 
        /*
         * if the leaf page bocome empty, free the page
                                        (nextindex - index -
                                         1) << L2XTSLOTSIZE);
 
-                       p->header.nextindex =
-                           cpu_to_le16(le16_to_cpu(p->header.nextindex) -
-                                       1);
+                       le16_add_cpu(&p->header.nextindex, -1);
                        jfs_info("xtDeleteUp(entry): 0x%lx[%d]",
                                 (ulong) parent->bn, index);
                }