Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6: JFS: Update print_hex_dump() syntax JFS: use print_hex_dump() rather than private dump_mem() function JFS: Whitespace cleanup and remove some dead code
This commit is contained in:
commit
71d441ddb5
26 changed files with 1091 additions and 1140 deletions
|
@ -26,34 +26,6 @@
|
|||
#include "jfs_filsys.h"
|
||||
#include "jfs_debug.h"
|
||||
|
||||
#ifdef CONFIG_JFS_DEBUG
|
||||
void dump_mem(char *label, void *data, int length)
|
||||
{
|
||||
int i, j;
|
||||
int *intptr = data;
|
||||
char *charptr = data;
|
||||
char buf[10], line[80];
|
||||
|
||||
printk("%s: dump of %d bytes of data at 0x%p\n\n", label, length,
|
||||
data);
|
||||
for (i = 0; i < length; i += 16) {
|
||||
line[0] = 0;
|
||||
for (j = 0; (j < 4) && (i + j * 4 < length); j++) {
|
||||
sprintf(buf, " %08x", intptr[i / 4 + j]);
|
||||
strcat(line, buf);
|
||||
}
|
||||
buf[0] = ' ';
|
||||
buf[2] = 0;
|
||||
for (j = 0; (j < 16) && (i + j < length); j++) {
|
||||
buf[1] =
|
||||
isprint(charptr[i + j]) ? charptr[i + j] : '.';
|
||||
strcat(line, buf);
|
||||
}
|
||||
printk("%s\n", line);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PROC_FS_JFS /* see jfs_debug.h */
|
||||
|
||||
static struct proc_dir_entry *base;
|
||||
|
|
|
@ -62,7 +62,6 @@ extern void jfs_proc_clean(void);
|
|||
|
||||
extern int jfsloglevel;
|
||||
|
||||
extern void dump_mem(char *label, void *data, int length);
|
||||
extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *);
|
||||
|
||||
/* information message: e.g., configuration, major event */
|
||||
|
@ -94,7 +93,6 @@ extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *);
|
|||
* ---------
|
||||
*/
|
||||
#else /* CONFIG_JFS_DEBUG */
|
||||
#define dump_mem(label,data,length) do {} while (0)
|
||||
#define ASSERT(p) do {} while (0)
|
||||
#define jfs_info(fmt, arg...) do {} while (0)
|
||||
#define jfs_debug(fmt, arg...) do {} while (0)
|
||||
|
|
|
@ -706,12 +706,6 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
|
|||
/* assert that nblocks is valid */
|
||||
assert(nblocks > 0);
|
||||
|
||||
#ifdef _STILL_TO_PORT
|
||||
/* DASD limit check F226941 */
|
||||
if (OVER_LIMIT(ip, nblocks))
|
||||
return -ENOSPC;
|
||||
#endif /* _STILL_TO_PORT */
|
||||
|
||||
/* get the log2 number of blocks to be allocated.
|
||||
* if the number of blocks is not a log2 multiple,
|
||||
* it will be rounded up to the next log2 multiple.
|
||||
|
@ -720,7 +714,6 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
|
|||
|
||||
bmp = JFS_SBI(ip->i_sb)->bmap;
|
||||
|
||||
//retry: /* serialize w.r.t.extendfs() */
|
||||
mapSize = bmp->db_mapsize;
|
||||
|
||||
/* the hint should be within the map */
|
||||
|
@ -3953,8 +3946,8 @@ static int dbGetL2AGSize(s64 nblocks)
|
|||
* convert number of map pages to the zero origin top dmapctl level
|
||||
*/
|
||||
#define BMAPPGTOLEV(npages) \
|
||||
(((npages) <= 3 + MAXL0PAGES) ? 0 \
|
||||
: ((npages) <= 2 + MAXL1PAGES) ? 1 : 2)
|
||||
(((npages) <= 3 + MAXL0PAGES) ? 0 : \
|
||||
((npages) <= 2 + MAXL1PAGES) ? 1 : 2)
|
||||
|
||||
s64 dbMapFileSizeToMapSize(struct inode * ipbmap)
|
||||
{
|
||||
|
@ -3981,8 +3974,8 @@ s64 dbMapFileSizeToMapSize(struct inode * ipbmap)
|
|||
factor =
|
||||
(i == 2) ? MAXL1PAGES : ((i == 1) ? MAXL0PAGES : 1);
|
||||
complete = (u32) npages / factor;
|
||||
ndmaps += complete * ((i == 2) ? LPERCTL * LPERCTL
|
||||
: ((i == 1) ? LPERCTL : 1));
|
||||
ndmaps += complete * ((i == 2) ? LPERCTL * LPERCTL :
|
||||
((i == 1) ? LPERCTL : 1));
|
||||
|
||||
/* pages in last/incomplete child */
|
||||
npages = (u32) npages % factor;
|
||||
|
|
|
@ -1739,9 +1739,6 @@ static int dtExtendPage(tid_t tid,
|
|||
/* update buffer extent descriptor of extended page */
|
||||
xlen = lengthPXD(pxd);
|
||||
xsize = xlen << JFS_SBI(sb)->l2bsize;
|
||||
#ifdef _STILL_TO_PORT
|
||||
bmSetXD(smp, xaddr, xsize);
|
||||
#endif /* _STILL_TO_PORT */
|
||||
|
||||
/*
|
||||
* copy old stbl to new stbl at start of extended area
|
||||
|
@ -2581,9 +2578,7 @@ int dtRelocate(tid_t tid, struct inode *ip, s64 lmxaddr, pxd_t * opxd,
|
|||
|
||||
/* update the buffer extent descriptor of the dtpage */
|
||||
xsize = xlen << JFS_SBI(ip->i_sb)->l2bsize;
|
||||
#ifdef _STILL_TO_PORT
|
||||
bmSetXD(mp, nxaddr, xsize);
|
||||
#endif /* _STILL_TO_PORT */
|
||||
|
||||
/* unpin the relocated page */
|
||||
DT_PUTPAGE(mp);
|
||||
jfs_info("dtRelocate: target dtpage relocated.");
|
||||
|
|
|
@ -397,7 +397,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
|
|||
if ((rc = xtLookupList(ip, &lxdl, &xadl, 0)))
|
||||
return (rc);
|
||||
|
||||
/* check if not extent exists for the previous page.
|
||||
/* check if no extent exists for the previous page.
|
||||
* this is possible for sparse files.
|
||||
*/
|
||||
if (xadl.nxad == 0) {
|
||||
|
|
|
@ -83,7 +83,6 @@
|
|||
/* case-insensitive name/directory support */
|
||||
|
||||
#define JFS_AIX 0x80000000 /* AIX support */
|
||||
/* POSIX name/directory support - Never implemented*/
|
||||
|
||||
/*
|
||||
* buffer cache configuration
|
||||
|
|
|
@ -802,7 +802,6 @@ int diWrite(tid_t tid, struct inode *ip)
|
|||
/*
|
||||
* lock/copy inode base: 128 byte slot granularity
|
||||
*/
|
||||
// baseDinode:
|
||||
lv = & dilinelock->lv[dilinelock->index];
|
||||
lv->offset = dioffset >> L2INODESLOTSIZE;
|
||||
copy_to_dinode(dp, ip);
|
||||
|
@ -813,17 +812,6 @@ int diWrite(tid_t tid, struct inode *ip)
|
|||
lv->length = 1;
|
||||
dilinelock->index++;
|
||||
|
||||
#ifdef _JFS_FASTDASD
|
||||
/*
|
||||
* We aren't logging changes to the DASD used in directory inodes,
|
||||
* but we need to write them to disk. If we don't unmount cleanly,
|
||||
* mount will recalculate the DASD used.
|
||||
*/
|
||||
if (S_ISDIR(ip->i_mode)
|
||||
&& (ip->i_ipmnt->i_mntflag & JFS_DASD_ENABLED))
|
||||
memcpy(&dp->di_DASD, &ip->i_DASD, sizeof(struct dasd));
|
||||
#endif /* _JFS_FASTDASD */
|
||||
|
||||
/* release the buffer holding the updated on-disk inode.
|
||||
* the buffer will be later written by commit processing.
|
||||
*/
|
||||
|
@ -902,7 +890,8 @@ int diFree(struct inode *ip)
|
|||
* the map.
|
||||
*/
|
||||
if (iagno >= imap->im_nextiag) {
|
||||
dump_mem("imap", imap, 32);
|
||||
print_hex_dump(KERN_ERR, "imap: ", DUMP_PREFIX_ADDRESS, 16, 4,
|
||||
imap, 32, 0);
|
||||
jfs_error(ip->i_sb,
|
||||
"diFree: inum = %d, iagno = %d, nextiag = %d",
|
||||
(uint) inum, iagno, imap->im_nextiag);
|
||||
|
@ -2481,9 +2470,6 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
|
|||
s64 xaddr = 0;
|
||||
s64 blkno;
|
||||
tid_t tid;
|
||||
#ifdef _STILL_TO_PORT
|
||||
xad_t xad;
|
||||
#endif /* _STILL_TO_PORT */
|
||||
struct inode *iplist[1];
|
||||
|
||||
/* pick up pointers to the inode map and mount inodes */
|
||||
|
|
|
@ -1622,20 +1622,26 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
|
|||
if (!list_empty(&log->synclist)) {
|
||||
struct logsyncblk *lp;
|
||||
|
||||
printk(KERN_ERR "jfs_flush_journal: synclist not empty\n");
|
||||
list_for_each_entry(lp, &log->synclist, synclist) {
|
||||
if (lp->xflag & COMMIT_PAGE) {
|
||||
struct metapage *mp = (struct metapage *)lp;
|
||||
dump_mem("orphan metapage", lp,
|
||||
sizeof(struct metapage));
|
||||
dump_mem("page", mp->page, sizeof(struct page));
|
||||
}
|
||||
else
|
||||
dump_mem("orphan tblock", lp,
|
||||
sizeof(struct tblock));
|
||||
print_hex_dump(KERN_ERR, "metapage: ",
|
||||
DUMP_PREFIX_ADDRESS, 16, 4,
|
||||
mp, sizeof(struct metapage), 0);
|
||||
print_hex_dump(KERN_ERR, "page: ",
|
||||
DUMP_PREFIX_ADDRESS, 16,
|
||||
sizeof(long), mp->page,
|
||||
sizeof(struct page), 0);
|
||||
} else
|
||||
print_hex_dump(KERN_ERR, "tblock:",
|
||||
DUMP_PREFIX_ADDRESS, 16, 4,
|
||||
lp, sizeof(struct tblock), 0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
WARN_ON(!list_empty(&log->synclist));
|
||||
#endif
|
||||
//assert(list_empty(&log->synclist));
|
||||
clear_bit(log_FLUSH, &log->flag);
|
||||
}
|
||||
|
||||
|
|
|
@ -472,7 +472,8 @@ add_failed:
|
|||
printk(KERN_ERR "JFS: bio_add_page failed unexpectedly\n");
|
||||
goto skip;
|
||||
dump_bio:
|
||||
dump_mem("bio", bio, sizeof(*bio));
|
||||
print_hex_dump(KERN_ERR, "JFS: dump of bio: ", DUMP_PREFIX_ADDRESS, 16,
|
||||
4, bio, sizeof(*bio), 0);
|
||||
skip:
|
||||
bio_put(bio);
|
||||
unlock_page(page);
|
||||
|
|
|
@ -829,12 +829,16 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
|
|||
/* Only locks on ipimap or ipaimap should reach here */
|
||||
/* assert(jfs_ip->fileset == AGGREGATE_I); */
|
||||
if (jfs_ip->fileset != AGGREGATE_I) {
|
||||
jfs_err("txLock: trying to lock locked page!");
|
||||
dump_mem("ip", ip, sizeof(struct inode));
|
||||
dump_mem("mp", mp, sizeof(struct metapage));
|
||||
dump_mem("Locker's tblk", tid_to_tblock(tid),
|
||||
sizeof(struct tblock));
|
||||
dump_mem("Tlock", tlck, sizeof(struct tlock));
|
||||
printk(KERN_ERR "txLock: trying to lock locked page!");
|
||||
print_hex_dump(KERN_ERR, "ip: ", DUMP_PREFIX_ADDRESS, 16, 4,
|
||||
ip, sizeof(*ip), 0);
|
||||
print_hex_dump(KERN_ERR, "mp: ", DUMP_PREFIX_ADDRESS, 16, 4,
|
||||
mp, sizeof(*mp), 0);
|
||||
print_hex_dump(KERN_ERR, "Locker's tblock: ",
|
||||
DUMP_PREFIX_ADDRESS, 16, 4, tid_to_tblock(tid),
|
||||
sizeof(struct tblock), 0);
|
||||
print_hex_dump(KERN_ERR, "Tlock: ", DUMP_PREFIX_ADDRESS, 16, 4,
|
||||
tlck, sizeof(*tlck), 0);
|
||||
BUG();
|
||||
}
|
||||
INCREMENT(stattx.waitlock); /* statistics */
|
||||
|
|
|
@ -1468,13 +1468,12 @@ xtSplitPage(tid_t tid, struct inode *ip,
|
|||
* xtSplitRoot()
|
||||
*
|
||||
* function:
|
||||
* split the full root page into
|
||||
* original/root/split page and new right page
|
||||
* i.e., root remains fixed in tree anchor (inode) and
|
||||
* the root is copied to a single new right child page
|
||||
* since root page << non-root page, and
|
||||
* the split root page contains a single entry for the
|
||||
* new right child page.
|
||||
* split the full root page into original/root/split page and new
|
||||
* right page
|
||||
* i.e., root remains fixed in tree anchor (inode) and the root is
|
||||
* copied to a single new right child page since root page <<
|
||||
* non-root page, and the split root page contains a single entry
|
||||
* for the new right child page.
|
||||
*
|
||||
* parameter:
|
||||
* int tid,
|
||||
|
@ -3026,16 +3025,14 @@ xtRelocate(tid_t tid, struct inode * ip, xad_t * oxad, /* old XAD */
|
|||
*/
|
||||
if (lmp) {
|
||||
BT_MARK_DIRTY(lmp, ip);
|
||||
tlck =
|
||||
txLock(tid, ip, lmp, tlckXTREE | tlckRELINK);
|
||||
tlck = txLock(tid, ip, lmp, tlckXTREE | tlckRELINK);
|
||||
lp->header.next = cpu_to_le64(nxaddr);
|
||||
XT_PUTPAGE(lmp);
|
||||
}
|
||||
|
||||
if (rmp) {
|
||||
BT_MARK_DIRTY(rmp, ip);
|
||||
tlck =
|
||||
txLock(tid, ip, rmp, tlckXTREE | tlckRELINK);
|
||||
tlck = txLock(tid, ip, rmp, tlckXTREE | tlckRELINK);
|
||||
rp->header.prev = cpu_to_le64(nxaddr);
|
||||
XT_PUTPAGE(rmp);
|
||||
}
|
||||
|
@ -4099,8 +4096,7 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
|
|||
*/
|
||||
tlck = txLock(tid, ip, mp, tlckXTREE);
|
||||
xtlck = (struct xtlock *) & tlck->lock;
|
||||
xtlck->hwm.offset =
|
||||
le16_to_cpu(p->header.nextindex) - 1;
|
||||
xtlck->hwm.offset = le16_to_cpu(p->header.nextindex) - 1;
|
||||
tlck->type = tlckXTREE | tlckFREE;
|
||||
|
||||
XT_PUTPAGE(mp);
|
||||
|
|
|
@ -590,7 +590,8 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size)
|
|||
size_check:
|
||||
if (EALIST_SIZE(ea_buf->xattr) != ea_size) {
|
||||
printk(KERN_ERR "ea_get: invalid extended attribute\n");
|
||||
dump_mem("xattr", ea_buf->xattr, ea_size);
|
||||
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_ADDRESS, 16, 1,
|
||||
ea_buf->xattr, ea_size, 1);
|
||||
ea_release(inode, ea_buf);
|
||||
rc = -EIO;
|
||||
goto clean_up;
|
||||
|
|
Loading…
Add table
Reference in a new issue