Update of /cvsroot/linuxdc/linux-sh-dc/fs/vmufs
In directory usw-pr-cvs1:/tmp/cvs-serv3198/fs/vmufs
Modified Files:
Tag: linux-sh-dc-2_4-branch
inode.c
Log Message:
vmufs should now handle more than first 16 files
Index: inode.c
===================================================================
RCS file: /cvsroot/linuxdc/linux-sh-dc/fs/vmufs/Attic/inode.c,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -d -r1.1.2.10 -r1.1.2.11
--- inode.c 5 Nov 2002 00:03:04 -0000 1.1.2.10
+++ inode.c 5 Nov 2002 23:55:26 -0000 1.1.2.11
@@ -106,6 +106,7 @@
struct inode *inode = dentry->d_inode;
struct super_block *sb = inode->i_sb;
struct buffer_head *bh = bread(sb->s_dev, 253, 512);
+ int blck_read = 253; /* Traverse through all blocks of VMU directory */
int i = filp->f_pos;
switch ((unsigned int) filp->f_pos) {
@@ -134,17 +135,25 @@
kmalloc(sizeof(struct vmufs_file_info), GFP_KERNEL);
do {
+ if ((i - 2) / 0x10 > (blck_read - 253)) { /* move to next block in directory */
+ brelse(bh);
+ blck_read++;
+ bh = bread(sb->s_dev, blck_read, 512);
+ }
+
saved_file->ftype =
- ((__u8 *) bh->b_data)[0 + (i - 2) * 0x20];
+ ((__u8 *) bh->b_data)[0 + ((i - 2) % 0x10) * 0x20];
if (saved_file->ftype == 0)
break;
saved_file->fblk =
le16_to_cpu(((__u16 *) bh->b_data)[1 +
- (i - 2) * 0x10]);
- memcpy(saved_file->fname, bh->b_data + 4 + (i - 2) * 0x20,
- 12);
+ ((i -
+ 2) % 0x10) *
+ 0x10]);
+ memcpy(saved_file->fname,
+ bh->b_data + 4 + ((i - 2) % 0x10) * 0x20, 12);
if (filldir
(dirent, saved_file->fname, 12, i++, saved_file->fblk,
@@ -189,7 +198,8 @@
count = file_len - *ppos;
blcks_to_read = count >> in->i_sb->s_blocksize_bits;
- if (blcks_to_read == 0) return 0;
+ if (blcks_to_read == 0)
+ return 0;
readbuf = kmalloc(count, GFP_KERNEL);
/* Trverse through FAT to read the blocks in */
@@ -199,7 +209,8 @@
/*Walk through to where we are */
if (blkoffset > 0) {
do {
- next_block = ((__u16 *) bh_fat->b_data)[next_block];
+ next_block =
+ ((__u16 *) bh_fat->b_data)[next_block];
blkoffset--;
} while (blkoffset > 0);
}
|