diff options
Diffstat (limited to 'fs/jfs/jfs_imap.c')
-rw-r--r-- | fs/jfs/jfs_imap.c | 69 |
1 files changed, 29 insertions, 40 deletions
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index f7e042b63ddb..f321986e73d2 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c | |||
@@ -386,7 +386,7 @@ int diRead(struct inode *ip) | |||
386 | dp += rel_inode; | 386 | dp += rel_inode; |
387 | 387 | ||
388 | if (ip->i_ino != le32_to_cpu(dp->di_number)) { | 388 | if (ip->i_ino != le32_to_cpu(dp->di_number)) { |
389 | jfs_error(ip->i_sb, "diRead: i_ino != di_number"); | 389 | jfs_error(ip->i_sb, "i_ino != di_number\n"); |
390 | rc = -EIO; | 390 | rc = -EIO; |
391 | } else if (le32_to_cpu(dp->di_nlink) == 0) | 391 | } else if (le32_to_cpu(dp->di_nlink) == 0) |
392 | rc = -ESTALE; | 392 | rc = -ESTALE; |
@@ -625,7 +625,7 @@ int diWrite(tid_t tid, struct inode *ip) | |||
625 | if (!addressPXD(&(jfs_ip->ixpxd)) || | 625 | if (!addressPXD(&(jfs_ip->ixpxd)) || |
626 | (lengthPXD(&(jfs_ip->ixpxd)) != | 626 | (lengthPXD(&(jfs_ip->ixpxd)) != |
627 | JFS_IP(ipimap)->i_imap->im_nbperiext)) { | 627 | JFS_IP(ipimap)->i_imap->im_nbperiext)) { |
628 | jfs_error(ip->i_sb, "diWrite: ixpxd invalid"); | 628 | jfs_error(ip->i_sb, "ixpxd invalid\n"); |
629 | return -EIO; | 629 | return -EIO; |
630 | } | 630 | } |
631 | 631 | ||
@@ -893,8 +893,7 @@ int diFree(struct inode *ip) | |||
893 | if (iagno >= imap->im_nextiag) { | 893 | if (iagno >= imap->im_nextiag) { |
894 | print_hex_dump(KERN_ERR, "imap: ", DUMP_PREFIX_ADDRESS, 16, 4, | 894 | print_hex_dump(KERN_ERR, "imap: ", DUMP_PREFIX_ADDRESS, 16, 4, |
895 | imap, 32, 0); | 895 | imap, 32, 0); |
896 | jfs_error(ip->i_sb, | 896 | jfs_error(ip->i_sb, "inum = %d, iagno = %d, nextiag = %d\n", |
897 | "diFree: inum = %d, iagno = %d, nextiag = %d", | ||
898 | (uint) inum, iagno, imap->im_nextiag); | 897 | (uint) inum, iagno, imap->im_nextiag); |
899 | return -EIO; | 898 | return -EIO; |
900 | } | 899 | } |
@@ -930,15 +929,14 @@ int diFree(struct inode *ip) | |||
930 | mask = HIGHORDER >> bitno; | 929 | mask = HIGHORDER >> bitno; |
931 | 930 | ||
932 | if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { | 931 | if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { |
933 | jfs_error(ip->i_sb, | 932 | jfs_error(ip->i_sb, "wmap shows inode already free\n"); |
934 | "diFree: wmap shows inode already free"); | ||
935 | } | 933 | } |
936 | 934 | ||
937 | if (!addressPXD(&iagp->inoext[extno])) { | 935 | if (!addressPXD(&iagp->inoext[extno])) { |
938 | release_metapage(mp); | 936 | release_metapage(mp); |
939 | IREAD_UNLOCK(ipimap); | 937 | IREAD_UNLOCK(ipimap); |
940 | AG_UNLOCK(imap, agno); | 938 | AG_UNLOCK(imap, agno); |
941 | jfs_error(ip->i_sb, "diFree: invalid inoext"); | 939 | jfs_error(ip->i_sb, "invalid inoext\n"); |
942 | return -EIO; | 940 | return -EIO; |
943 | } | 941 | } |
944 | 942 | ||
@@ -950,7 +948,7 @@ int diFree(struct inode *ip) | |||
950 | release_metapage(mp); | 948 | release_metapage(mp); |
951 | IREAD_UNLOCK(ipimap); | 949 | IREAD_UNLOCK(ipimap); |
952 | AG_UNLOCK(imap, agno); | 950 | AG_UNLOCK(imap, agno); |
953 | jfs_error(ip->i_sb, "diFree: numfree > numinos"); | 951 | jfs_error(ip->i_sb, "numfree > numinos\n"); |
954 | return -EIO; | 952 | return -EIO; |
955 | } | 953 | } |
956 | /* | 954 | /* |
@@ -1199,7 +1197,7 @@ int diFree(struct inode *ip) | |||
1199 | * for the inode being freed. | 1197 | * for the inode being freed. |
1200 | */ | 1198 | */ |
1201 | if (iagp->pmap[extno] != 0) { | 1199 | if (iagp->pmap[extno] != 0) { |
1202 | jfs_error(ip->i_sb, "diFree: the pmap does not show inode free"); | 1200 | jfs_error(ip->i_sb, "the pmap does not show inode free\n"); |
1203 | } | 1201 | } |
1204 | iagp->wmap[extno] = 0; | 1202 | iagp->wmap[extno] = 0; |
1205 | PXDlength(&iagp->inoext[extno], 0); | 1203 | PXDlength(&iagp->inoext[extno], 0); |
@@ -1518,8 +1516,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip) | |||
1518 | release_metapage(mp); | 1516 | release_metapage(mp); |
1519 | AG_UNLOCK(imap, agno); | 1517 | AG_UNLOCK(imap, agno); |
1520 | jfs_error(ip->i_sb, | 1518 | jfs_error(ip->i_sb, |
1521 | "diAlloc: can't find free bit " | 1519 | "can't find free bit in wmap\n"); |
1522 | "in wmap"); | ||
1523 | return -EIO; | 1520 | return -EIO; |
1524 | } | 1521 | } |
1525 | 1522 | ||
@@ -1660,7 +1657,7 @@ diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip) | |||
1660 | numinos = imap->im_agctl[agno].numinos; | 1657 | numinos = imap->im_agctl[agno].numinos; |
1661 | 1658 | ||
1662 | if (numfree > numinos) { | 1659 | if (numfree > numinos) { |
1663 | jfs_error(ip->i_sb, "diAllocAG: numfree > numinos"); | 1660 | jfs_error(ip->i_sb, "numfree > numinos\n"); |
1664 | return -EIO; | 1661 | return -EIO; |
1665 | } | 1662 | } |
1666 | 1663 | ||
@@ -1811,8 +1808,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) | |||
1811 | if (!iagp->nfreeinos) { | 1808 | if (!iagp->nfreeinos) { |
1812 | IREAD_UNLOCK(imap->im_ipimap); | 1809 | IREAD_UNLOCK(imap->im_ipimap); |
1813 | release_metapage(mp); | 1810 | release_metapage(mp); |
1814 | jfs_error(ip->i_sb, | 1811 | jfs_error(ip->i_sb, "nfreeinos = 0, but iag on freelist\n"); |
1815 | "diAllocIno: nfreeinos = 0, but iag on freelist"); | ||
1816 | return -EIO; | 1812 | return -EIO; |
1817 | } | 1813 | } |
1818 | 1814 | ||
@@ -1824,7 +1820,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) | |||
1824 | IREAD_UNLOCK(imap->im_ipimap); | 1820 | IREAD_UNLOCK(imap->im_ipimap); |
1825 | release_metapage(mp); | 1821 | release_metapage(mp); |
1826 | jfs_error(ip->i_sb, | 1822 | jfs_error(ip->i_sb, |
1827 | "diAllocIno: free inode not found in summary map"); | 1823 | "free inode not found in summary map\n"); |
1828 | return -EIO; | 1824 | return -EIO; |
1829 | } | 1825 | } |
1830 | 1826 | ||
@@ -1839,7 +1835,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) | |||
1839 | if (rem >= EXTSPERSUM) { | 1835 | if (rem >= EXTSPERSUM) { |
1840 | IREAD_UNLOCK(imap->im_ipimap); | 1836 | IREAD_UNLOCK(imap->im_ipimap); |
1841 | release_metapage(mp); | 1837 | release_metapage(mp); |
1842 | jfs_error(ip->i_sb, "diAllocIno: no free extent found"); | 1838 | jfs_error(ip->i_sb, "no free extent found\n"); |
1843 | return -EIO; | 1839 | return -EIO; |
1844 | } | 1840 | } |
1845 | extno = (sword << L2EXTSPERSUM) + rem; | 1841 | extno = (sword << L2EXTSPERSUM) + rem; |
@@ -1850,7 +1846,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) | |||
1850 | if (rem >= INOSPEREXT) { | 1846 | if (rem >= INOSPEREXT) { |
1851 | IREAD_UNLOCK(imap->im_ipimap); | 1847 | IREAD_UNLOCK(imap->im_ipimap); |
1852 | release_metapage(mp); | 1848 | release_metapage(mp); |
1853 | jfs_error(ip->i_sb, "diAllocIno: free inode not found"); | 1849 | jfs_error(ip->i_sb, "free inode not found\n"); |
1854 | return -EIO; | 1850 | return -EIO; |
1855 | } | 1851 | } |
1856 | 1852 | ||
@@ -1936,7 +1932,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip) | |||
1936 | IREAD_LOCK(imap->im_ipimap, RDWRLOCK_IMAP); | 1932 | IREAD_LOCK(imap->im_ipimap, RDWRLOCK_IMAP); |
1937 | if ((rc = diIAGRead(imap, iagno, &mp))) { | 1933 | if ((rc = diIAGRead(imap, iagno, &mp))) { |
1938 | IREAD_UNLOCK(imap->im_ipimap); | 1934 | IREAD_UNLOCK(imap->im_ipimap); |
1939 | jfs_error(ip->i_sb, "diAllocExt: error reading iag"); | 1935 | jfs_error(ip->i_sb, "error reading iag\n"); |
1940 | return rc; | 1936 | return rc; |
1941 | } | 1937 | } |
1942 | iagp = (struct iag *) mp->data; | 1938 | iagp = (struct iag *) mp->data; |
@@ -1948,8 +1944,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip) | |||
1948 | if (sword >= SMAPSZ) { | 1944 | if (sword >= SMAPSZ) { |
1949 | release_metapage(mp); | 1945 | release_metapage(mp); |
1950 | IREAD_UNLOCK(imap->im_ipimap); | 1946 | IREAD_UNLOCK(imap->im_ipimap); |
1951 | jfs_error(ip->i_sb, | 1947 | jfs_error(ip->i_sb, "free ext summary map not found\n"); |
1952 | "diAllocExt: free ext summary map not found"); | ||
1953 | return -EIO; | 1948 | return -EIO; |
1954 | } | 1949 | } |
1955 | if (~iagp->extsmap[sword]) | 1950 | if (~iagp->extsmap[sword]) |
@@ -1962,7 +1957,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip) | |||
1962 | if (rem >= EXTSPERSUM) { | 1957 | if (rem >= EXTSPERSUM) { |
1963 | release_metapage(mp); | 1958 | release_metapage(mp); |
1964 | IREAD_UNLOCK(imap->im_ipimap); | 1959 | IREAD_UNLOCK(imap->im_ipimap); |
1965 | jfs_error(ip->i_sb, "diAllocExt: free extent not found"); | 1960 | jfs_error(ip->i_sb, "free extent not found\n"); |
1966 | return -EIO; | 1961 | return -EIO; |
1967 | } | 1962 | } |
1968 | extno = (sword << L2EXTSPERSUM) + rem; | 1963 | extno = (sword << L2EXTSPERSUM) + rem; |
@@ -2081,8 +2076,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino) | |||
2081 | if (bmp) | 2076 | if (bmp) |
2082 | release_metapage(bmp); | 2077 | release_metapage(bmp); |
2083 | 2078 | ||
2084 | jfs_error(imap->im_ipimap->i_sb, | 2079 | jfs_error(imap->im_ipimap->i_sb, "iag inconsistent\n"); |
2085 | "diAllocBit: iag inconsistent"); | ||
2086 | return -EIO; | 2080 | return -EIO; |
2087 | } | 2081 | } |
2088 | 2082 | ||
@@ -2189,7 +2183,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno) | |||
2189 | /* better have free extents. | 2183 | /* better have free extents. |
2190 | */ | 2184 | */ |
2191 | if (!iagp->nfreeexts) { | 2185 | if (!iagp->nfreeexts) { |
2192 | jfs_error(imap->im_ipimap->i_sb, "diNewExt: no free extents"); | 2186 | jfs_error(imap->im_ipimap->i_sb, "no free extents\n"); |
2193 | return -EIO; | 2187 | return -EIO; |
2194 | } | 2188 | } |
2195 | 2189 | ||
@@ -2261,7 +2255,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno) | |||
2261 | } | 2255 | } |
2262 | if (ciagp == NULL) { | 2256 | if (ciagp == NULL) { |
2263 | jfs_error(imap->im_ipimap->i_sb, | 2257 | jfs_error(imap->im_ipimap->i_sb, |
2264 | "diNewExt: ciagp == NULL"); | 2258 | "ciagp == NULL\n"); |
2265 | rc = -EIO; | 2259 | rc = -EIO; |
2266 | goto error_out; | 2260 | goto error_out; |
2267 | } | 2261 | } |
@@ -2498,7 +2492,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) | |||
2498 | IWRITE_UNLOCK(ipimap); | 2492 | IWRITE_UNLOCK(ipimap); |
2499 | IAGFREE_UNLOCK(imap); | 2493 | IAGFREE_UNLOCK(imap); |
2500 | jfs_error(imap->im_ipimap->i_sb, | 2494 | jfs_error(imap->im_ipimap->i_sb, |
2501 | "diNewIAG: ipimap->i_size is wrong"); | 2495 | "ipimap->i_size is wrong\n"); |
2502 | return -EIO; | 2496 | return -EIO; |
2503 | } | 2497 | } |
2504 | 2498 | ||
@@ -2758,8 +2752,7 @@ diUpdatePMap(struct inode *ipimap, | |||
2758 | iagno = INOTOIAG(inum); | 2752 | iagno = INOTOIAG(inum); |
2759 | /* make sure that the iag is contained within the map */ | 2753 | /* make sure that the iag is contained within the map */ |
2760 | if (iagno >= imap->im_nextiag) { | 2754 | if (iagno >= imap->im_nextiag) { |
2761 | jfs_error(ipimap->i_sb, | 2755 | jfs_error(ipimap->i_sb, "the iag is outside the map\n"); |
2762 | "diUpdatePMap: the iag is outside the map"); | ||
2763 | return -EIO; | 2756 | return -EIO; |
2764 | } | 2757 | } |
2765 | /* read the iag */ | 2758 | /* read the iag */ |
@@ -2788,13 +2781,13 @@ diUpdatePMap(struct inode *ipimap, | |||
2788 | */ | 2781 | */ |
2789 | if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { | 2782 | if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { |
2790 | jfs_error(ipimap->i_sb, | 2783 | jfs_error(ipimap->i_sb, |
2791 | "diUpdatePMap: inode %ld not marked as " | 2784 | "inode %ld not marked as allocated in wmap!\n", |
2792 | "allocated in wmap!", inum); | 2785 | inum); |
2793 | } | 2786 | } |
2794 | if (!(le32_to_cpu(iagp->pmap[extno]) & mask)) { | 2787 | if (!(le32_to_cpu(iagp->pmap[extno]) & mask)) { |
2795 | jfs_error(ipimap->i_sb, | 2788 | jfs_error(ipimap->i_sb, |
2796 | "diUpdatePMap: inode %ld not marked as " | 2789 | "inode %ld not marked as allocated in pmap!\n", |
2797 | "allocated in pmap!", inum); | 2790 | inum); |
2798 | } | 2791 | } |
2799 | /* update the bitmap for the extent of the freed inode */ | 2792 | /* update the bitmap for the extent of the freed inode */ |
2800 | iagp->pmap[extno] &= cpu_to_le32(~mask); | 2793 | iagp->pmap[extno] &= cpu_to_le32(~mask); |
@@ -2809,15 +2802,13 @@ diUpdatePMap(struct inode *ipimap, | |||
2809 | if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { | 2802 | if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { |
2810 | release_metapage(mp); | 2803 | release_metapage(mp); |
2811 | jfs_error(ipimap->i_sb, | 2804 | jfs_error(ipimap->i_sb, |
2812 | "diUpdatePMap: the inode is not allocated in " | 2805 | "the inode is not allocated in the working map\n"); |
2813 | "the working map"); | ||
2814 | return -EIO; | 2806 | return -EIO; |
2815 | } | 2807 | } |
2816 | if ((le32_to_cpu(iagp->pmap[extno]) & mask) != 0) { | 2808 | if ((le32_to_cpu(iagp->pmap[extno]) & mask) != 0) { |
2817 | release_metapage(mp); | 2809 | release_metapage(mp); |
2818 | jfs_error(ipimap->i_sb, | 2810 | jfs_error(ipimap->i_sb, |
2819 | "diUpdatePMap: the inode is not free in the " | 2811 | "the inode is not free in the persistent map\n"); |
2820 | "persistent map"); | ||
2821 | return -EIO; | 2812 | return -EIO; |
2822 | } | 2813 | } |
2823 | /* update the bitmap for the extent of the allocated inode */ | 2814 | /* update the bitmap for the extent of the allocated inode */ |
@@ -2909,8 +2900,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap) | |||
2909 | iagp = (struct iag *) bp->data; | 2900 | iagp = (struct iag *) bp->data; |
2910 | if (le32_to_cpu(iagp->iagnum) != i) { | 2901 | if (le32_to_cpu(iagp->iagnum) != i) { |
2911 | release_metapage(bp); | 2902 | release_metapage(bp); |
2912 | jfs_error(ipimap->i_sb, | 2903 | jfs_error(ipimap->i_sb, "unexpected value of iagnum\n"); |
2913 | "diExtendFs: unexpected value of iagnum"); | ||
2914 | return -EIO; | 2904 | return -EIO; |
2915 | } | 2905 | } |
2916 | 2906 | ||
@@ -2986,8 +2976,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap) | |||
2986 | 2976 | ||
2987 | if (xnuminos != atomic_read(&imap->im_numinos) || | 2977 | if (xnuminos != atomic_read(&imap->im_numinos) || |
2988 | xnumfree != atomic_read(&imap->im_numfree)) { | 2978 | xnumfree != atomic_read(&imap->im_numfree)) { |
2989 | jfs_error(ipimap->i_sb, | 2979 | jfs_error(ipimap->i_sb, "numinos or numfree incorrect\n"); |
2990 | "diExtendFs: numinos or numfree incorrect"); | ||
2991 | return -EIO; | 2980 | return -EIO; |
2992 | } | 2981 | } |
2993 | 2982 | ||