linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / jfs / jfs_extent.c
index ecf3ac3..ecd440e 100644 (file)
@@ -95,7 +95,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr)
        txBeginAnon(ip->i_sb);
 
        /* Avoid race with jfs_commit_inode() */
-       mutex_lock(&JFS_IP(ip)->commit_mutex);
+       down(&JFS_IP(ip)->commit_sem);
 
        /* validate extent length */
        if (xlen > MAXXLEN)
@@ -127,7 +127,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr)
 
        /* allocate the disk blocks for the extent.  initially, extBalloc()
         * will try to allocate disk blocks for the requested size (xlen). 
-        * if this fails (xlen contiguous free blocks not avaliable), it'll
+        * if this fails (xlen contigious free blocks not avaliable), it'll
         * try to allocate a smaller number of blocks (producing a smaller
         * extent), with this smaller number of blocks consisting of the
         * requested number of blocks rounded down to the next smaller
@@ -137,21 +137,21 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr)
         */
        nxlen = xlen;
        if ((rc = extBalloc(ip, hint ? hint : INOHINT(ip), &nxlen, &nxaddr))) {
-               mutex_unlock(&JFS_IP(ip)->commit_mutex);
+               up(&JFS_IP(ip)->commit_sem);
                return (rc);
        }
 
        /* Allocate blocks to quota. */
        if (DQUOT_ALLOC_BLOCK(ip, nxlen)) {
                dbFree(ip, nxaddr, (s64) nxlen);
-               mutex_unlock(&JFS_IP(ip)->commit_mutex);
+               up(&JFS_IP(ip)->commit_sem);
                return -EDQUOT;
        }
        /* Allocate blocks to dlimit. */
        if (DLIMIT_ALLOC_BLOCK(ip, nxlen)) {
                DQUOT_FREE_BLOCK(ip, nxlen);
                dbFree(ip, nxaddr, (s64) nxlen);
-               mutex_unlock(&JFS_IP(ip)->commit_mutex);
+               up(&JFS_IP(ip)->commit_sem);
                return -ENOSPC;
        }
 
@@ -174,7 +174,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr)
                dbFree(ip, nxaddr, nxlen);
                DLIMIT_FREE_BLOCK(ip, nxlen);
                DQUOT_FREE_BLOCK(ip, nxlen);
-               mutex_unlock(&JFS_IP(ip)->commit_mutex);
+               up(&JFS_IP(ip)->commit_sem);
                return (rc);
        }
 
@@ -186,7 +186,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr)
 
        mark_inode_dirty(ip);
 
-       mutex_unlock(&JFS_IP(ip)->commit_mutex);
+       up(&JFS_IP(ip)->commit_sem);
        /*
         * COMMIT_SyncList flags an anonymous tlock on page that is on
         * sync list.
@@ -231,7 +231,7 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr)
        /* This blocks if we are low on resources */
        txBeginAnon(ip->i_sb);
 
-       mutex_lock(&JFS_IP(ip)->commit_mutex);
+       down(&JFS_IP(ip)->commit_sem);
        /* validate extent length */
        if (nxlen > MAXXLEN)
                nxlen = MAXXLEN;
@@ -267,7 +267,7 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr)
        /* Allocat blocks to quota. */
        if (DQUOT_ALLOC_BLOCK(ip, nxlen)) {
                dbFree(ip, nxaddr, (s64) nxlen);
-               mutex_unlock(&JFS_IP(ip)->commit_mutex);
+               up(&JFS_IP(ip)->commit_sem);
                return -EDQUOT;
        }
        /* Allocate blocks to dlimit. */
@@ -356,7 +356,7 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr)
 
        mark_inode_dirty(ip);
 exit:
-       mutex_unlock(&JFS_IP(ip)->commit_mutex);
+       up(&JFS_IP(ip)->commit_sem);
        return (rc);
 }
 #endif                 /* _NOTYET */
@@ -457,12 +457,12 @@ int extRecord(struct inode *ip, xad_t * xp)
 
        txBeginAnon(ip->i_sb);
 
-       mutex_lock(&JFS_IP(ip)->commit_mutex);
+       down(&JFS_IP(ip)->commit_sem);
 
        /* update the extent */
        rc = xtUpdate(0, ip, xp);
 
-       mutex_unlock(&JFS_IP(ip)->commit_mutex);
+       up(&JFS_IP(ip)->commit_sem);
        return rc;
 }
 
@@ -486,7 +486,7 @@ int extRecord(struct inode *ip, xad_t * xp)
 int extFill(struct inode *ip, xad_t * xp)
 {
        int rc, nbperpage = JFS_SBI(ip->i_sb)->nbperpage;
-       s64 blkno = offsetXAD(xp) >> ip->i_blkbits;
+       s64 blkno = offsetXAD(xp) >> ip->i_blksize;
 
 //      assert(ISSPARSE(ip));
 
@@ -511,7 +511,7 @@ int extFill(struct inode *ip, xad_t * xp)
  *
  *             initially, we will try to allocate disk blocks for the
  *             requested size (nblocks).  if this fails (nblocks 
- *             contiguous free blocks not avaliable), we'll try to allocate
+ *             contigious free blocks not avaliable), we'll try to allocate
  *             a smaller number of blocks (producing a smaller extent), with
  *             this smaller number of blocks consisting of the requested
  *             number of blocks rounded down to the next smaller power of 2
@@ -547,7 +547,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
 
        /* get the number of blocks to initially attempt to allocate.
         * we'll first try the number of blocks requested unless this
-        * number is greater than the maximum number of contiguous free
+        * number is greater than the maximum number of contigious free
         * blocks in the map. in that case, we'll start off with the 
         * maximum free.
         */
@@ -604,7 +604,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
  *             in place.  if this fails, we'll try to move the extent
  *             to a new set of blocks. if moving the extent, we initially
  *             will try to allocate disk blocks for the requested size
- *             (nnew).  if this fails  (new contiguous free blocks not
+ *             (nnew).  if this fails  (nnew contigious free blocks not
  *             avaliable), we'll try  to allocate a smaller number of
  *             blocks (producing a smaller extent), with this smaller
  *             number of blocks consisting of the requested number of