This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / jfs / jfs_imap.c
index efba306..1c77abc 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/pagemap.h>
 #include <linux/quotaops.h>
 #include <linux/vserver/xid.h>
+#include <linux/quotaops.h>
 
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
@@ -132,7 +133,7 @@ int diMount(struct inode *ipimap)
        struct inomap *imap;
        struct metapage *mp;
        int index;
-       struct dinomap_disk *dinom_le;
+       struct dinomap *dinom_le;
 
        /*
         * allocate/initialize the in-memory inode map control structure
@@ -155,7 +156,7 @@ int diMount(struct inode *ipimap)
        }
 
        /* copy the on-disk version to the in-memory version. */
-       dinom_le = (struct dinomap_disk *) mp->data;
+       dinom_le = (struct dinomap *) mp->data;
        imap->im_freeiag = le32_to_cpu(dinom_le->in_freeiag);
        imap->im_nextiag = le32_to_cpu(dinom_le->in_nextiag);
        atomic_set(&imap->im_numinos, le32_to_cpu(dinom_le->in_numinos));
@@ -243,7 +244,7 @@ int diUnmount(struct inode *ipimap, int mounterror)
  */
 int diSync(struct inode *ipimap)
 {
-       struct dinomap_disk *dinom_le;
+       struct dinomap *dinom_le;
        struct inomap *imp = JFS_IP(ipimap)->i_imap;
        struct metapage *mp;
        int index;
@@ -261,7 +262,7 @@ int diSync(struct inode *ipimap)
        }
 
        /* copy the in-memory version to the on-disk version */
-       dinom_le = (struct dinomap_disk *) mp->data;
+       dinom_le = (struct dinomap *) mp->data;
        dinom_le->in_freeiag = cpu_to_le32(imp->im_freeiag);
        dinom_le->in_nextiag = cpu_to_le32(imp->im_nextiag);
        dinom_le->in_numinos = cpu_to_le32(atomic_read(&imp->im_numinos));
@@ -1028,7 +1029,7 @@ int diFree(struct inode *ip)
                         */
                        iagp->inofreefwd =
                            cpu_to_le32(imap->im_agctl[agno].inofree);
-                       iagp->inofreeback = cpu_to_le32(-1);
+                       iagp->inofreeback = -1;
                        imap->im_agctl[agno].inofree = iagno;
                }
                IREAD_UNLOCK(ipimap);
@@ -1038,7 +1039,7 @@ int diFree(struct inode *ip)
                 * inodes (i.e., the inode being freed is the first free 
                 * inode of extent),
                 */
-               if (iagp->wmap[extno] == cpu_to_le32(ONES)) {
+               if (iagp->wmap[extno] == ONES) {
                        sword = extno >> L2EXTSPERSUM;
                        bitno = extno & (EXTSPERSUM - 1);
                        iagp->inosmap[sword] &=
@@ -1186,7 +1187,7 @@ int diFree(struct inode *ip)
 
                iagp->extfreefwd =
                    cpu_to_le32(imap->im_agctl[agno].extfree);
-               iagp->extfreeback = cpu_to_le32(-1);
+               iagp->extfreeback = -1;
                imap->im_agctl[agno].extfree = iagno;
        } else {
                /* remove the iag from the ag extent list if all extents
@@ -1202,7 +1203,7 @@ int diFree(struct inode *ip)
                                imap->im_agctl[agno].extfree =
                                    le32_to_cpu(iagp->extfreefwd);
 
-                       iagp->extfreefwd = iagp->extfreeback = cpu_to_le32(-1);
+                       iagp->extfreefwd = iagp->extfreeback = -1;
 
                        IAGFREE_LOCK(imap);
                        iagp->iagfree = cpu_to_le32(imap->im_freeiag);
@@ -1224,7 +1225,7 @@ int diFree(struct inode *ip)
                        imap->im_agctl[agno].inofree =
                            le32_to_cpu(iagp->inofreefwd);
 
-               iagp->inofreefwd = iagp->inofreeback = cpu_to_le32(-1);
+               iagp->inofreefwd = iagp->inofreeback = -1;
        }
 
        /* update the inode extent address and working map 
@@ -2132,7 +2133,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
         * allocated.  if so, update the free inode summary
         * map to reflect this.
         */
-       if (iagp->wmap[extno] == cpu_to_le32(ONES)) {
+       if (iagp->wmap[extno] == ONES) {
                sword = extno >> L2EXTSPERSUM;
                bitno = extno & (EXTSPERSUM - 1);
                iagp->inosmap[sword] |= cpu_to_le32(HIGHORDER >> bitno);
@@ -2154,7 +2155,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
                        imap->im_agctl[agno].inofree =
                            le32_to_cpu(iagp->inofreefwd);
                }
-               iagp->inofreefwd = iagp->inofreeback = cpu_to_le32(-1);
+               iagp->inofreefwd = iagp->inofreeback = -1;
        }
 
        /* update the free inode count at the iag, ag, inode
@@ -2363,7 +2364,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
                        imap->im_agctl[agno].extfree =
                            le32_to_cpu(iagp->extfreefwd);
 
-               iagp->extfreefwd = iagp->extfreeback = cpu_to_le32(-1);
+               iagp->extfreefwd = iagp->extfreeback = -1;
        } else {
                /* if the iag has all free extents (newly allocated iag),
                 * add the iag to the ag free extent list.
@@ -2373,7 +2374,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
                                aiagp->extfreeback = cpu_to_le32(iagno);
 
                        iagp->extfreefwd = cpu_to_le32(fwd);
-                       iagp->extfreeback = cpu_to_le32(-1);
+                       iagp->extfreeback = -1;
                        imap->im_agctl[agno].extfree = iagno;
                }
        }
@@ -2387,7 +2388,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
 
                iagp->inofreefwd =
                    cpu_to_le32(imap->im_agctl[agno].inofree);
-               iagp->inofreeback = cpu_to_le32(-1);
+               iagp->inofreeback = -1;
                imap->im_agctl[agno].inofree = iagno;
        }
 
@@ -2593,9 +2594,9 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
                /* init the iag */
                memset(iagp, 0, sizeof(struct iag));
                iagp->iagnum = cpu_to_le32(iagno);
-               iagp->inofreefwd = iagp->inofreeback = cpu_to_le32(-1);
-               iagp->extfreefwd = iagp->extfreeback = cpu_to_le32(-1);
-               iagp->iagfree = cpu_to_le32(-1);
+               iagp->inofreefwd = iagp->inofreeback = -1;
+               iagp->extfreefwd = iagp->extfreeback = -1;
+               iagp->iagfree = -1;
                iagp->nfreeinos = 0;
                iagp->nfreeexts = cpu_to_le32(EXTSPERIAG);
 
@@ -2603,7 +2604,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
                 * summary map initialization handled by bzero).
                 */
                for (i = 0; i < SMAPSZ; i++)
-                       iagp->inosmap[i] = cpu_to_le32(ONES);
+                       iagp->inosmap[i] = ONES;
 
                flush_metapage(mp);
 
@@ -2677,7 +2678,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
 
        /* remove the iag from the iag free list */
        imap->im_freeiag = le32_to_cpu(iagp->iagfree);
-       iagp->iagfree = cpu_to_le32(-1);
+       iagp->iagfree = -1;
 
        /* set the return iag number and buffer pointer */
        *iagnop = iagno;
@@ -2925,8 +2926,8 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
 
        /* init per AG control information im_agctl[] */
        for (i = 0; i < MAXAG; i++) {
-               imap->im_agctl[i].inofree = -1;
-               imap->im_agctl[i].extfree = -1;
+               imap->im_agctl[i].inofree = -1; /* free inode list */
+               imap->im_agctl[i].extfree = -1; /* free extent list */
                imap->im_agctl[i].numinos = 0;  /* number of backed inodes */
                imap->im_agctl[i].numfree = 0;  /* number of free backed inodes */
        }
@@ -2971,18 +2972,18 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
 
                /* if any backed free inodes, insert at AG free inode list */
                if ((int) le32_to_cpu(iagp->nfreeinos) > 0) {
-                       if ((head = imap->im_agctl[n].inofree) == -1) {
-                               iagp->inofreefwd = cpu_to_le32(-1);
-                               iagp->inofreeback = cpu_to_le32(-1);
-                       } else {
+                       if ((head = imap->im_agctl[n].inofree) == -1)
+                               iagp->inofreefwd = iagp->inofreeback = -1;
+                       else {
                                if ((rc = diIAGRead(imap, head, &hbp))) {
                                        rcx = rc;
                                        goto nextiag;
                                }
                                hiagp = (struct iag *) hbp->data;
-                               hiagp->inofreeback = iagp->iagnum;
+                               hiagp->inofreeback =
+                                   le32_to_cpu(iagp->iagnum);
                                iagp->inofreefwd = cpu_to_le32(head);
-                               iagp->inofreeback = cpu_to_le32(-1);
+                               iagp->inofreeback = -1;
                                write_metapage(hbp);
                        }
 
@@ -2997,10 +2998,9 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
 
                /* if any free extents, insert at AG free extent list */
                if (le32_to_cpu(iagp->nfreeexts) > 0) {
-                       if ((head = imap->im_agctl[n].extfree) == -1) {
-                               iagp->extfreefwd = cpu_to_le32(-1);
-                               iagp->extfreeback = cpu_to_le32(-1);
-                       } else {
+                       if ((head = imap->im_agctl[n].extfree) == -1)
+                               iagp->extfreefwd = iagp->extfreeback = -1;
+                       else {
                                if ((rc = diIAGRead(imap, head, &hbp))) {
                                        rcx = rc;
                                        goto nextiag;
@@ -3008,7 +3008,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
                                hiagp = (struct iag *) hbp->data;
                                hiagp->extfreeback = iagp->iagnum;
                                iagp->extfreefwd = cpu_to_le32(head);
-                               iagp->extfreeback = cpu_to_le32(-1);
+                               iagp->extfreeback = -1;
                                write_metapage(hbp);
                        }
 
@@ -3055,7 +3055,7 @@ static void duplicateIXtree(struct super_block *sb, s64 blkno,
                if (readSuper(sb, &bh))
                        return;
                j_sb = (struct jfs_superblock *)bh->b_data;
-               j_sb->s_flag |= cpu_to_le32(JFS_BAD_SAIT);
+               j_sb->s_flag |= JFS_BAD_SAIT;
 
                mark_buffer_dirty(bh);
                sync_dirty_buffer(bh);