From: Adrian M. <zx8...@us...> - 2002-11-06 23:59:09
|
Update of /cvsroot/linuxdc/linux-sh-dc/fs/vmufs In directory usw-pr-cvs1:/tmp/cvs-serv29605/fs/vmufs Modified Files: Tag: linux-sh-dc-2_4-branch super.c inode.c Log Message: More vmufs fixes Index: super.c =================================================================== RCS file: /cvsroot/linuxdc/linux-sh-dc/fs/vmufs/Attic/super.c,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -u -d -r1.1.2.9 -r1.1.2.10 --- super.c 5 Nov 2002 00:03:04 -0000 1.1.2.9 +++ super.c 6 Nov 2002 23:59:06 -0000 1.1.2.10 @@ -85,7 +85,8 @@ in->i_version = ++event; brelse(bh); } else { - struct buffer_head *bh = bread(sb->s_dev, 253, 512); + int blck_read = 253; + struct buffer_head *bh = bread(sb->s_dev, blck_read, 512); int y; if (in->i_ino > 199) { @@ -105,7 +106,12 @@ /* Scan through the directory to find the matching file */ for (y = 0; y < 200; y++) { - if (((__u16 *) bh->b_data)[y * 0x10 + 0x01] == + if ((y / 0x10) > (253 - blck_read)){ + brelse(bh); + blck_read--; + bh = bread(sb->s_dev, blck_read, 512); + } + if (((__u16 *) bh->b_data)[(y % 0x10) * 0x10 + 0x01] == in->i_ino) break; } @@ -117,13 +123,13 @@ } /* identified the correct directory entry */ - century = int_from_bcd((bh->b_data)[0x10 + y * 0x20]); - year = int_from_bcd((bh->b_data)[0x11 + y * 0x20]); - month = int_from_bcd((bh->b_data)[0x12 + y * 0x20]); - day = int_from_bcd((bh->b_data)[0x13 + y * 0x20]); - hour = int_from_bcd((bh->b_data)[0x14 + y * 0x20]); - minute = int_from_bcd((bh->b_data)[0x15 + y * 0x20]); - second = int_from_bcd((bh->b_data)[0x16 + y * 0x20]); + century = int_from_bcd((bh->b_data)[0x10 + (y % 0x10) * 0x20]); + year = int_from_bcd((bh->b_data)[0x11 + (y % 0x10) * 0x20]); + month = int_from_bcd((bh->b_data)[0x12 + (y % 0x10) * 0x20]); + day = int_from_bcd((bh->b_data)[0x13 + (y % 0x10) * 0x20]); + hour = int_from_bcd((bh->b_data)[0x14 + (y % 0x10) * 0x20]); + minute = int_from_bcd((bh->b_data)[0x15 + (y % 0x10) * 0x20]); + second = int_from_bcd((bh->b_data)[0x16 + (y % 0x10) * 0x20]); in->i_ctime = in->i_mtime = mktime(century * 100 + year, month, day, hour, minute, @@ -132,10 +138,10 @@ in->i_mode |= S_IRUGO; /* Mode - is the file copiable? */ - if (((__u8 *) bh->b_data)[0x01 + y * 0x20] == 0x00) + if (((__u8 *) bh->b_data)[0x01 + (y % 0x10) * 0x20] == 0x00) in->i_mode |= S_IWUGO; /* Is file executible - ie a game */ - if (((__u8 *) bh->b_data)[y * 0x20] == 0xcc) + if (((__u8 *) bh->b_data)[(y % 0x10) * 0x20] == 0xcc) in->i_mode |= S_IXUGO; in->i_uid = in->i_gid = 0; @@ -144,7 +150,7 @@ in->i_fop = &vmufs_file_operations; in->i_blocks = - le16_to_cpu(((__u16 *) bh->b_data)[y * 0x10 + 0x0C]); + le16_to_cpu(((__u16 *) bh->b_data)[(y % 0x10) * 0x10 + 0x0C]); in->i_size = in->i_blocks * 512; in->i_blksize = 512; Index: inode.c =================================================================== RCS file: /cvsroot/linuxdc/linux-sh-dc/fs/vmufs/Attic/inode.c,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -u -d -r1.1.2.11 -r1.1.2.12 --- inode.c 5 Nov 2002 23:55:26 -0000 1.1.2.11 +++ inode.c 6 Nov 2002 23:59:06 -0000 1.1.2.12 @@ -22,7 +22,8 @@ struct dentry *vmufs_inode_lookup(struct inode *in, struct dentry *dent) { struct super_block *sb = in->i_sb; - struct buffer_head *bh = bread(sb->s_dev, 253, 512); + int blck_read = 253; + struct buffer_head *bh = bread(sb->s_dev, blck_read, 512); struct vmufs_file_info *first_one = NULL; struct vmufs_file_info *last_one = NULL; int fno = 0; @@ -45,12 +46,17 @@ last_one->next = saved_file; last_one = saved_file; saved_file->copy_pro = - ((__u8 *) bh->b_data)[1 + fno * 0x20]; - saved_file->fblk = ((__u16 *) bh->b_data)[1 + fno * 0x10]; - memcpy(saved_file->fname, bh->b_data + 4 + fno * 0x20, 12); + ((__u8 *) bh->b_data)[1 + (fno % 0x10) * 0x20]; + saved_file->fblk = ((__u16 *) bh->b_data)[1 + (fno % 0x10) * 0x10]; + memcpy(saved_file->fname, bh->b_data + 4 + (fno % 0x10) * 0x20, 12); fno++; + if ((fno/0x10)> (253 - blck_read)){ + brelse(bh); + blck_read--; + bh = bread(sb->s_dev, blck_read, 512); + } } while (1); @@ -135,9 +141,9 @@ kmalloc(sizeof(struct vmufs_file_info), GFP_KERNEL); do { - if ((i - 2) / 0x10 > (blck_read - 253)) { /* move to next block in directory */ + if ((i - 2) / 0x10 > (253 - blck_read)) { /* move to next block in directory */ brelse(bh); - blck_read++; + blck_read--; bh = bread(sb->s_dev, blck_read, 512); } |