Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.26-rc3 /fs/jfs/jfs_dmap.c

Filename:/fs/jfs/jfs_dmap.c
Lines Added:21
Lines Deleted:15
Also changed in: (Previous) 2.4.23  2.4.23-rc5  2.4.23-rc4  2.4.23-rc3  2.4.23-rc2  2.4.23-rc1 
(Following) 2.4.26-rc4  2.4.26  2.4.27-pre6  2.4.27-rc1  2.4.27-rc2  2.4.27-rc3 

Location
[  2.4.26-rc3
  [  fs
    [  jfs
       o  jfs_dmap.c

Patch

diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.25/fs/jfs/jfs_dmap.c linux-2.4.26-rc3/fs/jfs/jfs_dmap.c
--- linux-2.4.25/fs/jfs/jfs_dmap.c   2003-11-28 18:26:21.000000000 +0000
+++ linux-2.4.26-rc3/fs/jfs/jfs_dmap.c   2004-04-12 19:01:41.000000000 +0000
@@ -125,7 +125,7 @@ static int dbAllocAG(struct bmap * bmp, 
            s64 * results);
 static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,
             s64 * results);
-int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
+static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
 static int dbFindBits(u32 word, int l2nb);
 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
 static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx);
@@ -135,10 +135,10 @@ static int dbFreeDmap(struct bmap * bmp,
             int nblocks);
 static int dbMaxBud(u8 * cp);
 s64 dbMapFileSizeToMapSize(struct inode *ipbmap);
-int blkstol2(s64 nb);
+static int blkstol2(s64 nb);
 
-int cntlz(u32 value);
-int cnttz(u32 word);
+static int cntlz(u32 value);
+static int cnttz(u32 word);
 
 static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
           int nblocks);
@@ -156,7 +156,7 @@ static int dbGetL2AGSize(s64 nblocks);
  * into the table, with the table elements yielding the maximum
  * binary buddy of free bits within the character.
  */
-signed char budtab[256] = {
+static s8 budtab[256] = {
    3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
    2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -943,7 +943,7 @@ int dbAlloc(struct inode *ip, s64 hint, 
    return (rc);
 }
 
-
+#ifdef _NOTYET
 /*
  * NAME:   dbAllocExact()
  *
@@ -1010,7 +1010,7 @@ int dbAllocExact(struct inode *ip, s64 b
 
    return (rc);
 }
-
+#endif /* _NOTYET */
 
 /*
  * NAME:   dbReAlloc()
@@ -1093,7 +1093,7 @@ dbReAlloc(struct inode *ip,
  *      -ENOSPC   - insufficient disk resources
  *      -EIO   - i/o error
  */
-int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
+static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
 {
    struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
    s64 lblkno, lastblkno, extblkno;
@@ -1527,6 +1527,7 @@ dbAllocAG(struct bmap * bmp, int agno, s
          if (n == 4) {
             jfs_error(bmp->db_ipbmap->i_sb,
                  "dbAllocAG: failed descending stree");
+            release_metapage(mp);
             return -EIO;
          }
       }
@@ -3023,7 +3024,7 @@ static int dbMaxBud(u8 * cp)
  * RETURN VALUES:
  *      count of trailing zeros
  */
-int cnttz(u32 word)
+static int cnttz(u32 word)
 {
    int n;
 
@@ -3048,7 +3049,7 @@ int cnttz(u32 word)
  * RETURN VALUES:
  *      count of leading zeros
  */
-int cntlz(u32 value)
+static int cntlz(u32 value)
 {
    int n;
 
@@ -3311,7 +3312,7 @@ int dbExtendFS(struct inode *ipbmap, s64
    int i, i0 = TRUE, j, j0 = TRUE, k, n;
    s64 newsize;
    s64 p;
-   struct metapage *mp, *l2mp, *l1mp, *l0mp;
+   struct metapage *mp, *l2mp, *l1mp = NULL, *l0mp = NULL;
    struct dmapctl *l2dcp, *l1dcp, *l0dcp;
    struct dmap *dp;
    s8 *l0leaf, *l1leaf, *l2leaf;
@@ -3514,6 +3515,7 @@ int dbExtendFS(struct inode *ipbmap, s64
           */
          *l1leaf = dbInitDmapCtl(l0dcp, 0, ++i);
          write_metapage(l0mp);
+         l0mp = NULL;
 
          if (nblocks)
             l1leaf++;   /* continue for next L0 */
@@ -3537,6 +3539,7 @@ int dbExtendFS(struct inode *ipbmap, s64
        */
       *l2leaf = dbInitDmapCtl(l1dcp, 1, ++j);
       write_metapage(l1mp);
+      l1mp = NULL;
 
       if (nblocks)
          l2leaf++;   /* continue for next L1 */
@@ -3555,17 +3558,20 @@ int dbExtendFS(struct inode *ipbmap, s64
 
    jfs_error(ipbmap->i_sb,
         "dbExtendFS: function has not returned as expected");
+errout:
+   if (l0mp)
+      release_metapage(l0mp);
+   if (l1mp)
+      release_metapage(l1mp);
+   release_metapage(l2mp);
    return -EIO;
 
    /*
     *      finalize bmap control page
     */
-      finalize:
+finalize:
 
    return 0;
-
-      errout:
-   return -EIO;
 }
 
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.