aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/jfs_imap.c
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2005-06-27 16:35:37 -0400
committerDave Kleikamp <shaggy@austin.ibm.com>2005-06-27 16:35:37 -0400
commitb38a3ab3d1bb0dc3288f73903d4dc4672b5cd2d0 (patch)
tree31d017dd1f9f4a8ca3e80d25d110c64ae82d4aae /fs/jfs/jfs_imap.c
parentf5f287738bddf38ec9ca79344f00dab675e1bbf5 (diff)
JFS: Code cleanup - getting rid of never-used debug code
I'm finally getting around to cleaning out debug code that I've never used. There has always been code ifdef'ed out by _JFS_DEBUG_DMAP, _JFS_DEBUG_IMAP, _JFS_DEBUG_DTREE, and _JFS_DEBUG_XTREE, which I have personally never used, and I doubt that anyone has since the design stage back in OS/2. There is also a function, xtGather, that has never been used, and I don't know why it was ever there. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'fs/jfs/jfs_imap.c')
-rw-r--r--fs/jfs/jfs_imap.c105
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 *);
87static void copy_to_dinode(struct dinode *, struct inode *); 87static 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
99static void *DBGdiInit(struct inomap * imap);
100static void DBGdiAlloc(struct inomap * imap, ino_t ino);
101static 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 */
3193static 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 */
3207static 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 */
3225static 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
3240static 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
3254static 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 */