diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-19 17:49:39 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-19 17:49:39 -0400 |
commit | 39299d9d15c41cbdd7c7009967cd35afaf34d8fa (patch) | |
tree | 42a0c0408fcf76024eb6885a27d4f1ed0228abcf /fs/jfs/jfs_imap.c | |
parent | ce625a801664d8ed7344117bbb57510e4e0e872c (diff) | |
parent | f60f700876cd51de9de69f3a3c865d95e287a24d (diff) |
Merge with /shiny/git/linux-2.6/.git
Diffstat (limited to 'fs/jfs/jfs_imap.c')
-rw-r--r-- | fs/jfs/jfs_imap.c | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 971af2977eff..4021d46da7e3 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c | |||
@@ -87,25 +87,6 @@ static int copy_from_dinode(struct dinode *, struct inode *); | |||
87 | static void copy_to_dinode(struct dinode *, struct inode *); | 87 | static void copy_to_dinode(struct dinode *, struct inode *); |
88 | 88 | ||
89 | /* | 89 | /* |
90 | * debug code for double-checking inode map | ||
91 | */ | ||
92 | /* #define _JFS_DEBUG_IMAP 1 */ | ||
93 | |||
94 | #ifdef _JFS_DEBUG_IMAP | ||
95 | #define DBG_DIINIT(imap) DBGdiInit(imap) | ||
96 | #define DBG_DIALLOC(imap, ino) DBGdiAlloc(imap, ino) | ||
97 | #define DBG_DIFREE(imap, ino) DBGdiFree(imap, ino) | ||
98 | |||
99 | static void *DBGdiInit(struct inomap * imap); | ||
100 | static void DBGdiAlloc(struct inomap * imap, ino_t ino); | ||
101 | static void DBGdiFree(struct inomap * imap, ino_t ino); | ||
102 | #else | ||
103 | #define DBG_DIINIT(imap) | ||
104 | #define DBG_DIALLOC(imap, ino) | ||
105 | #define DBG_DIFREE(imap, ino) | ||
106 | #endif /* _JFS_DEBUG_IMAP */ | ||
107 | |||
108 | /* | ||
109 | * NAME: diMount() | 90 | * NAME: diMount() |
110 | * | 91 | * |
111 | * FUNCTION: initialize the incore inode map control structures for | 92 | * FUNCTION: initialize the incore inode map control structures for |
@@ -188,8 +169,6 @@ int diMount(struct inode *ipimap) | |||
188 | imap->im_ipimap = ipimap; | 169 | imap->im_ipimap = ipimap; |
189 | JFS_IP(ipimap)->i_imap = imap; | 170 | JFS_IP(ipimap)->i_imap = imap; |
190 | 171 | ||
191 | // DBG_DIINIT(imap); | ||
192 | |||
193 | return (0); | 172 | return (0); |
194 | } | 173 | } |
195 | 174 | ||
@@ -1043,7 +1022,6 @@ int diFree(struct inode *ip) | |||
1043 | /* update the bitmap. | 1022 | /* update the bitmap. |
1044 | */ | 1023 | */ |
1045 | iagp->wmap[extno] = cpu_to_le32(bitmap); | 1024 | iagp->wmap[extno] = cpu_to_le32(bitmap); |
1046 | DBG_DIFREE(imap, inum); | ||
1047 | 1025 | ||
1048 | /* update the free inode counts at the iag, ag and | 1026 | /* update the free inode counts at the iag, ag and |
1049 | * map level. | 1027 | * map level. |
@@ -1231,7 +1209,6 @@ int diFree(struct inode *ip) | |||
1231 | jfs_error(ip->i_sb, "diFree: the pmap does not show inode free"); | 1209 | jfs_error(ip->i_sb, "diFree: the pmap does not show inode free"); |
1232 | } | 1210 | } |
1233 | iagp->wmap[extno] = 0; | 1211 | iagp->wmap[extno] = 0; |
1234 | DBG_DIFREE(imap, inum); | ||
1235 | PXDlength(&iagp->inoext[extno], 0); | 1212 | PXDlength(&iagp->inoext[extno], 0); |
1236 | PXDaddress(&iagp->inoext[extno], 0); | 1213 | PXDaddress(&iagp->inoext[extno], 0); |
1237 | 1214 | ||
@@ -1350,7 +1327,6 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp) | |||
1350 | struct jfs_inode_info *jfs_ip = JFS_IP(ip); | 1327 | struct jfs_inode_info *jfs_ip = JFS_IP(ip); |
1351 | 1328 | ||
1352 | ip->i_ino = (iagno << L2INOSPERIAG) + ino; | 1329 | ip->i_ino = (iagno << L2INOSPERIAG) + ino; |
1353 | DBG_DIALLOC(JFS_IP(ipimap)->i_imap, ip->i_ino); | ||
1354 | jfs_ip->ixpxd = iagp->inoext[extno]; | 1330 | jfs_ip->ixpxd = iagp->inoext[extno]; |
1355 | jfs_ip->agno = BLKTOAG(le64_to_cpu(iagp->agstart), sbi); | 1331 | jfs_ip->agno = BLKTOAG(le64_to_cpu(iagp->agstart), sbi); |
1356 | jfs_ip->active_ag = -1; | 1332 | jfs_ip->active_ag = -1; |
@@ -3185,84 +3161,3 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip) | |||
3185 | if (S_ISCHR(ip->i_mode) || S_ISBLK(ip->i_mode)) | 3161 | if (S_ISCHR(ip->i_mode) || S_ISBLK(ip->i_mode)) |
3186 | dip->di_rdev = cpu_to_le32(jfs_ip->dev); | 3162 | dip->di_rdev = cpu_to_le32(jfs_ip->dev); |
3187 | } | 3163 | } |
3188 | |||
3189 | #ifdef _JFS_DEBUG_IMAP | ||
3190 | /* | ||
3191 | * DBGdiInit() | ||
3192 | */ | ||
3193 | static void *DBGdiInit(struct inomap * imap) | ||
3194 | { | ||
3195 | u32 *dimap; | ||
3196 | int size; | ||
3197 | size = 64 * 1024; | ||
3198 | if ((dimap = (u32 *) xmalloc(size, L2PSIZE, kernel_heap)) == NULL) | ||
3199 | assert(0); | ||
3200 | bzero((void *) dimap, size); | ||
3201 | imap->im_DBGdimap = dimap; | ||
3202 | } | ||
3203 | |||
3204 | /* | ||
3205 | * DBGdiAlloc() | ||
3206 | */ | ||
3207 | static void DBGdiAlloc(struct inomap * imap, ino_t ino) | ||
3208 | { | ||
3209 | u32 *dimap = imap->im_DBGdimap; | ||
3210 | int w, b; | ||
3211 | u32 m; | ||
3212 | w = ino >> 5; | ||
3213 | b = ino & 31; | ||
3214 | m = 0x80000000 >> b; | ||
3215 | assert(w < 64 * 256); | ||
3216 | if (dimap[w] & m) { | ||
3217 | printk("DEBUG diAlloc: duplicate alloc ino:0x%x\n", ino); | ||
3218 | } | ||
3219 | dimap[w] |= m; | ||
3220 | } | ||
3221 | |||
3222 | /* | ||
3223 | * DBGdiFree() | ||
3224 | */ | ||
3225 | static void DBGdiFree(struct inomap * imap, ino_t ino) | ||
3226 | { | ||
3227 | u32 *dimap = imap->im_DBGdimap; | ||
3228 | int w, b; | ||
3229 | u32 m; | ||
3230 | w = ino >> 5; | ||
3231 | b = ino & 31; | ||
3232 | m = 0x80000000 >> b; | ||
3233 | assert(w < 64 * 256); | ||
3234 | if ((dimap[w] & m) == 0) { | ||
3235 | printk("DEBUG diFree: duplicate free ino:0x%x\n", ino); | ||
3236 | } | ||
3237 | dimap[w] &= ~m; | ||
3238 | } | ||
3239 | |||
3240 | static void dump_cp(struct inomap * ipimap, char *function, int line) | ||
3241 | { | ||
3242 | printk("\n* ********* *\nControl Page %s %d\n", function, line); | ||
3243 | printk("FreeIAG %d\tNextIAG %d\n", ipimap->im_freeiag, | ||
3244 | ipimap->im_nextiag); | ||
3245 | printk("NumInos %d\tNumFree %d\n", | ||
3246 | atomic_read(&ipimap->im_numinos), | ||
3247 | atomic_read(&ipimap->im_numfree)); | ||
3248 | printk("AG InoFree %d\tAG ExtFree %d\n", | ||
3249 | ipimap->im_agctl[0].inofree, ipimap->im_agctl[0].extfree); | ||
3250 | printk("AG NumInos %d\tAG NumFree %d\n", | ||
3251 | ipimap->im_agctl[0].numinos, ipimap->im_agctl[0].numfree); | ||
3252 | } | ||
3253 | |||
3254 | static void dump_iag(struct iag * iag, char *function, int line) | ||
3255 | { | ||
3256 | printk("\n* ********* *\nIAG %s %d\n", function, line); | ||
3257 | printk("IagNum %d\tIAG Free %d\n", le32_to_cpu(iag->iagnum), | ||
3258 | le32_to_cpu(iag->iagfree)); | ||
3259 | printk("InoFreeFwd %d\tInoFreeBack %d\n", | ||
3260 | le32_to_cpu(iag->inofreefwd), | ||
3261 | le32_to_cpu(iag->inofreeback)); | ||
3262 | printk("ExtFreeFwd %d\tExtFreeBack %d\n", | ||
3263 | le32_to_cpu(iag->extfreefwd), | ||
3264 | le32_to_cpu(iag->extfreeback)); | ||
3265 | printk("NFreeInos %d\tNFreeExts %d\n", le32_to_cpu(iag->nfreeinos), | ||
3266 | le32_to_cpu(iag->nfreeexts)); | ||
3267 | } | ||
3268 | #endif /* _JFS_DEBUG_IMAP */ | ||