home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-Online 1996 May
/
PCOnline_05_1996.bin
/
linux
/
source
/
kernel-s
/
v1.1
/
umsdos-0.000
< prev
next >
Wrap
Text File
|
1995-10-10
|
28KB
|
1,019 lines
This is a diff relative to linux 1.1.57 or later
This is mostly enhancement of the msdos fs driver to speed things
This is alpha!
diff -rc2P linux.1.1.57/fs/Makefile linux/fs/Makefile
*** linux.1.1.57/fs/Makefile Sat Oct 29 01:14:37 1994
--- linux/fs/Makefile Tue Oct 25 00:36:40 1994
***************
*** 21,24 ****
--- 21,26 ----
ifdef CONFIG_MSDOS_FS
FS_SUBDIRS := $(FS_SUBDIRS) msdos
+ else
+ MODULE_FS_SUBDIRS := $(MODULE_FS_SUBDIRS) msdos
endif
ifdef CONFIG_PROC_FS
***************
*** 36,39 ****
--- 38,43 ----
ifdef CONFIG_UMSDOS_FS
FS_SUBDIRS := $(FS_SUBDIRS) umsdos
+ else
+ MODULE_FS_SUBDIRS := $(MODULE_FS_SUBDIRS) umsdos
endif
ifdef CONFIG_SYSV_FS
***************
*** 77,80 ****
--- 81,88 ----
$(MAKE) CFLAGS="$(CFLAGS) -DMODULE" $(MODULES)
(cd ../modules;for i in $(MODULES); do ln -sf ../fs/$$i .; done)
+ set -e; for i in $(MODULE_FS_SUBDIRS); do \
+ test ! -d $$i || \
+ { $(MAKE) -C $$i; }; done
+
else
diff -rc2P linux.1.1.57/fs/msdos/Makefile linux/fs/msdos/Makefile
*** linux.1.1.57/fs/msdos/Makefile Sun Jul 24 10:39:44 1994
--- linux/fs/msdos/Makefile Tue Oct 25 22:10:49 1994
***************
*** 8,11 ****
--- 8,15 ----
# Note 2! The CFLAGS definitions are now in the main makefile...
+ ifndef CONFIG_MSDOS_FS
+ CFLAGS := $(CFLAGS) -DMODULE
+ endif
+
.c.s:
$(CC) $(CFLAGS) -S $<
***************
*** 15,19 ****
$(AS) -o $*.o $<
! OBJS= namei.o inode.o file.o dir.o misc.o fat.o mmap.o
msdos.o: $(OBJS)
--- 19,23 ----
$(AS) -o $*.o $<
! OBJS= namei.o inode.o file.o dir.o misc.o fat.o
msdos.o: $(OBJS)
diff -rc2P linux.1.1.57/fs/msdos/dir.c linux/fs/msdos/dir.c
*** linux.1.1.57/fs/msdos/dir.c Sat Oct 29 01:14:39 1994
--- linux/fs/msdos/dir.c Tue Oct 25 22:05:19 1994
***************
*** 19,22 ****
--- 19,24 ----
+ #define PRINTK(X)
+
static int msdos_dir_read(struct inode * inode,struct file * filp, char * buf,int count)
{
***************
*** 113,117 ****
--- 115,121 ----
memcpy_tofs(dirent->d_name,bufname,i+1);
put_fs_word(i,&dirent->d_reclen);
+ PRINTK (("readdir avant brelse\n"));
brelse(bh);
+ PRINTK (("readdir retourne %d\n",i));
return ROUND_UP(NAME_OFFSET(dirent) + i + 1);
}
diff -rc2P linux.1.1.57/fs/msdos/file.c linux/fs/msdos/file.c
*** linux.1.1.57/fs/msdos/file.c Sun Jul 24 10:39:44 1994
--- linux/fs/msdos/file.c Sat Oct 29 00:33:33 1994
***************
*** 11,14 ****
--- 11,15 ----
#include <linux/sched.h>
+ #include <linux/locks.h>
#include <linux/fs.h>
#include <linux/msdos_fs.h>
***************
*** 21,24 ****
--- 22,27 ----
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+ #define PRINTK(x)
+
static struct file_operations msdos_file_operations = {
NULL, /* lseek - default */
***************
*** 28,32 ****
NULL, /* select - default */
NULL, /* ioctl - default */
! msdos_mmap, /* mmap */
NULL, /* no special open is needed */
NULL, /* release */
--- 31,35 ----
NULL, /* select - default */
NULL, /* ioctl - default */
! generic_mmap, /* mmap */
NULL, /* no special open is needed */
NULL, /* release */
***************
*** 50,78 ****
msdos_truncate, /* truncate */
NULL, /* permission */
! msdos_smap /* smap */
! };
!
! /* No bmap for MS-DOS FS' that don't align data at kByte boundaries. */
!
! struct inode_operations msdos_file_inode_operations_no_bmap = {
! &msdos_file_operations, /* default file operations */
! NULL, /* create */
! NULL, /* lookup */
! NULL, /* link */
! NULL, /* unlink */
! NULL, /* symlink */
! NULL, /* mkdir */
! NULL, /* rmdir */
! NULL, /* mknod */
! NULL, /* rename */
! NULL, /* readlink */
! NULL, /* follow_link */
! NULL, /* bmap */
! msdos_truncate, /* truncate */
! NULL, /* permission */
! msdos_smap /* smap */
};
-
/*
Read a file into user space
--- 53,59 ----
msdos_truncate, /* truncate */
NULL, /* permission */
! NULL /* smap */
};
/*
Read a file into user space
***************
*** 85,94 ****
{
char *start;
! int left,offset,size,sector,cnt;
! char ch;
! struct buffer_head *bh;
! void *data;
- /* printk("msdos_file_read\n"); */
if (!inode) {
printk("msdos_file_read: inode = NULL\n");
--- 66,81 ----
{
char *start;
! int left,offset,size,cnt;
! struct {
! int to_reada; /* How many block to read all at once */
! struct buffer_head *bhreq[64]; /* Buffers not already read */
! int nbreq; /* Number of buffers to read */
! struct buffer_head *bhlist[64]; /* All buffers needed */
! int nblist; /* Number of buffers in bhlist */
! int nolist;
! }pre;
! int i;
!
if (!inode) {
printk("msdos_file_read: inode = NULL\n");
***************
*** 101,110 ****
}
if (filp->f_pos >= inode->i_size || count <= 0) return 0;
start = buf;
while ((left = MIN(inode->i_size-filp->f_pos,count-(buf-start))) > 0){
! if (!(sector = msdos_smap(inode,filp->f_pos >> SECTOR_BITS)))
! break;
offset = filp->f_pos & (SECTOR_SIZE-1);
- if (!(bh = msdos_sread(inode->i_dev,sector,&data))) break;
filp->f_pos += (size = MIN(SECTOR_SIZE-offset,left));
if (MSDOS_I(inode)->i_binary) {
--- 88,145 ----
}
if (filp->f_pos >= inode->i_size || count <= 0) return 0;
+ /*
+ Tell the buffer cache which block we expect to read in advance
+ Since we are limited with the stack, we preread only 64
+ because we have to keep the result into the local
+ arrays pre.bhlist and pre.bhreq.
+ */
+ {
+ int file_sector = filp->f_pos >> SECTOR_BITS;
+ pre.to_reada = count / SECTOR_SIZE;
+ if (filp->f_reada){
+ int min_read = read_ahead[MAJOR(inode->i_dev)];
+ if (min_read > pre.to_reada) pre.to_reada = min_read;
+ }
+ if (pre.to_reada > 64) pre.to_reada = 64;
+ pre.nbreq = pre.nblist = 0;
+ for (i=0; i<pre.to_reada; i++){
+ int sector;
+ struct buffer_head *bh;
+ if (!(sector = msdos_smap(inode,file_sector++))) break;
+ bh = getblk(inode->i_dev,sector,SECTOR_SIZE);
+ if (bh == NULL) break;
+ pre.bhlist[pre.nblist++] = bh;
+ if (!bh->b_uptodate){
+ pre.bhreq[pre.nbreq++] = bh;
+ }
+ }
+ if (pre.nbreq > 0) ll_rw_block (READ,pre.nbreq,pre.bhreq);
+ }
start = buf;
+ pre.nolist = 0;
while ((left = MIN(inode->i_size-filp->f_pos,count-(buf-start))) > 0){
! struct buffer_head *bh;
! void *data;
! PRINTK (("file_read pos %d\n",filp->f_pos));
! if (pre.nolist >= pre.nblist){
! /* This code is executed when more than 64 sectors */
! /* are request at once */
! int sector;
! if (!(sector = msdos_smap(inode,filp->f_pos >> SECTOR_BITS)))
! break;
! if (!(bh = msdos_sread(inode->i_dev,sector,&data)))
! break;
! }else{
! bh = pre.bhlist[pre.nolist];
! pre.bhlist[pre.nolist++] = NULL;
! data = bh->b_data;
! wait_on_buffer(bh);
! if (!bh->b_uptodate){
! /* read error ? */
! brelse (bh);
! break;
! }
! }
offset = filp->f_pos & (SECTOR_SIZE-1);
filp->f_pos += (size = MIN(SECTOR_SIZE-offset,left));
if (MSDOS_I(inode)->i_binary) {
***************
*** 113,116 ****
--- 148,152 ----
}
else for (cnt = size; cnt; cnt--) {
+ char ch;
if ((ch = *((char *) data+offset++)) == '\r')
size--;
***************
*** 120,128 ****
filp->f_pos = inode->i_size;
brelse(bh);
! if (start != buf
! && !IS_RDONLY(inode))
! inode->i_atime
! = CURRENT_TIME;
! return buf-start;
}
}
--- 156,160 ----
filp->f_pos = inode->i_size;
brelse(bh);
! break;
}
}
***************
*** 130,136 ****
--- 162,171 ----
brelse(bh);
}
+ for (i=0; i<pre.nblist; i++) brelse (pre.bhlist[i]);
if (start == buf) return -EIO;
if (!IS_RDONLY(inode))
inode->i_atime = CURRENT_TIME;
+ PRINTK (("file_read ret %d\n",(buf-start)));
+ filp->f_reada = 1; /* Will be reset if a lseek is done */
return buf-start;
}
***************
*** 150,153 ****
--- 185,189 ----
struct buffer_head *bh;
void *data;
+ int binary_mode = MSDOS_I(inode)->i_binary;
if (!inode) {
***************
*** 176,186 ****
offset = filp->f_pos & (SECTOR_SIZE-1);
size = MIN(SECTOR_SIZE-offset,MAX(carry,count));
! if (!(bh = msdos_sread(inode->i_dev,sector,&data))) {
error = -EIO;
break;
}
! if (MSDOS_I(inode)->i_binary) {
! memcpy_fromfs(data+(filp->f_pos & (SECTOR_SIZE-1)),
! buf,written = size);
buf += size;
}
--- 212,229 ----
offset = filp->f_pos & (SECTOR_SIZE-1);
size = MIN(SECTOR_SIZE-offset,MAX(carry,count));
! if (binary_mode && offset == 0 && size == SECTOR_SIZE){
! /* No need to read the block first since we will */
! /* completely overwrite it */
! if (!(bh = getblk(inode->i_dev,sector,SECTOR_SIZE))){
! error = -EIO;
! break;
! }
! data = bh->b_data;
! }else if (!(bh = msdos_sread(inode->i_dev,sector,&data))) {
error = -EIO;
break;
}
! if (binary_mode) {
! memcpy_fromfs(data+offset,buf,written = size);
buf += size;
}
***************
*** 211,214 ****
--- 254,258 ----
inode->i_dirt = 1;
}
+ bh->b_uptodate = 1;
mark_buffer_dirty(bh, 0);
brelse(bh);
diff -rc2P linux.1.1.57/fs/msdos/inode.c linux/fs/msdos/inode.c
*** linux.1.1.57/fs/msdos/inode.c Sat Oct 29 01:14:50 1994
--- linux/fs/msdos/inode.c Thu Oct 27 02:09:11 1994
***************
*** 11,19 ****
--- 11,27 ----
#include <linux/string.h>
#include <linux/ctype.h>
+ #include <linux/major.h>
+ #include <linux/fs.h>
#include <linux/stat.h>
#include <linux/locks.h>
+ #ifdef MODULE
+ #include <linux/module.h>
+ #include "../../tools/version.h"
+ #endif
+
#include <asm/segment.h>
+ extern int *blksize_size[];
void msdos_put_inode(struct inode *inode)
***************
*** 48,54 ****
--- 56,66 ----
{
cache_inval_dev(sb->s_dev);
+ set_blocksize (sb->s_dev,BLOCK_SIZE);
lock_super(sb);
sb->s_dev = 0;
unlock_super(sb);
+ #ifdef MODULE
+ MOD_DEC_USE_COUNT;
+ #endif
return;
}
***************
*** 161,165 ****
cache_init();
lock_super(s);
! bh = bread(s->s_dev, 0, BLOCK_SIZE);
unlock_super(s);
if (bh == NULL) {
--- 173,191 ----
cache_init();
lock_super(s);
! if (MAJOR(s->s_dev) == FLOPPY_MAJOR){
! /* Patch for floppy which lacks a table ??? */
! static int tbdef[]={
! 1024,1024,1024,1024,1024,
! 1024,1024,1024,1024,1024,
! 1024,1024,1024,1024,1024,
! 1024,1024,1024,1024,1024,
! 1024,1024,1024,1024,1024,
! 1024,1024,1024,1024,1024,
! 1024,1024,1024,1024,1024,
! };
! blksize_size[FLOPPY_MAJOR] = tbdef;
! }
! set_blocksize (s->s_dev,SECTOR_SIZE);
! bh = bread(s->s_dev, 0, SECTOR_SIZE);
unlock_super(s);
if (bh == NULL) {
***************
*** 169,175 ****
}
b = (struct msdos_boot_sector *) bh->b_data;
! s->s_blocksize = 1024; /* we cannot handle anything else yet */
! s->s_blocksize_bits = 10; /* we cannot handle anything else yet */
!
/*
* The DOS3 partition size limit is *not* 32M as many people think.
--- 195,203 ----
}
b = (struct msdos_boot_sector *) bh->b_data;
! s->s_blocksize = 512; /* Using this small block size solve the */
! /* the misfit with buffer cache and cluster */
! /* because cluster (DOS) are often aligned */
! /* on odd sector */
! s->s_blocksize_bits = 9; /* we cannot handle anything else yet */
/*
* The DOS3 partition size limit is *not* 32M as many people think.
***************
*** 220,223 ****
--- 248,252 ----
brelse(bh);
if (error || debug) {
+ /* The MSDOS_CAN_BMAP is obsolete, but left just to remember */
printk("[MS-DOS FS Rel. 12,FAT %d,check=%c,conv=%c,"
"uid=%d,gid=%d,umask=%03o%s]\n",MSDOS_SB(s)->fat_bits,check,
***************
*** 256,259 ****
--- 285,291 ----
return NULL;
}
+ #ifdef MODULE
+ MOD_INC_USE_COUNT;
+ #endif
return s;
}
***************
*** 291,303 ****
sb = MSDOS_SB(inode->i_sb);
- if ((sb->cluster_size & 1) || (sb->data_start & 1)) return 0;
if (inode->i_ino == MSDOS_ROOT_INO) {
! if (sb->dir_start & 1) return 0;
! return (sb->dir_start >> 1)+block;
}
! cluster = (block*2)/sb->cluster_size;
! offset = (block*2) % sb->cluster_size;
if (!(cluster = get_cluster(inode,cluster))) return 0;
! return ((cluster-2)*sb->cluster_size+sb->data_start+offset) >> 1;
}
--- 323,333 ----
sb = MSDOS_SB(inode->i_sb);
if (inode->i_ino == MSDOS_ROOT_INO) {
! return sb->dir_start + block;
}
! cluster = block/sb->cluster_size;
! offset = block % sb->cluster_size;
if (!(cluster = get_cluster(inode,cluster))) return 0;
! return (cluster-2)*sb->cluster_size+sb->data_start+offset;
}
***************
*** 333,337 ****
}
if (!(bh = bread(inode->i_dev,inode->i_ino >> MSDOS_DPB_BITS,
! BLOCK_SIZE))) {
printk("dev = 0x%04X, ino = %ld\n",inode->i_dev,inode->i_ino);
panic("msdos_read_inode: unable to read i-node block");
--- 363,367 ----
}
if (!(bh = bread(inode->i_dev,inode->i_ino >> MSDOS_DPB_BITS,
! SECTOR_SIZE))) {
printk("dev = 0x%04X, ino = %ld\n",inode->i_dev,inode->i_ino);
panic("msdos_read_inode: unable to read i-node block");
***************
*** 368,374 ****
? S_IRUGO|S_IWUGO : S_IRWXUGO) & ~MSDOS_SB(inode->i_sb)->fs_umask) |
S_IFREG;
! inode->i_op = MSDOS_CAN_BMAP(MSDOS_SB(inode->i_sb)) ?
! &msdos_file_inode_operations :
! &msdos_file_inode_operations_no_bmap;
MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
inode->i_nlink = 1;
--- 398,402 ----
? S_IRUGO|S_IWUGO : S_IRWXUGO) & ~MSDOS_SB(inode->i_sb)->fs_umask) |
S_IFREG;
! inode->i_op = &msdos_file_inode_operations; /* Now can always bmap */
MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
inode->i_nlink = 1;
***************
*** 396,400 ****
if (inode->i_ino == MSDOS_ROOT_INO || !inode->i_nlink) return;
if (!(bh = bread(inode->i_dev,inode->i_ino >> MSDOS_DPB_BITS,
! BLOCK_SIZE))) {
printk("dev = 0x%04X, ino = %ld\n",inode->i_dev,inode->i_ino);
panic("msdos_write_inode: unable to read i-node block");
--- 424,428 ----
if (inode->i_ino == MSDOS_ROOT_INO || !inode->i_nlink) return;
if (!(bh = bread(inode->i_dev,inode->i_ino >> MSDOS_DPB_BITS,
! SECTOR_SIZE))) {
printk("dev = 0x%04X, ino = %ld\n",inode->i_dev,inode->i_ino);
panic("msdos_write_inode: unable to read i-node block");
***************
*** 452,453 ****
--- 480,510 ----
return 0;
}
+ #ifdef MODULE
+
+ char kernel_version[] = UTS_RELEASE;
+
+ static struct file_system_type msdos_fs_type = {
+ msdos_read_super, "msdos", 1, NULL
+ };
+
+ int init_module(void)
+ {
+ register_filesystem(&msdos_fs_type);
+ return 0;
+ }
+
+ void cleanup_module(void)
+ {
+ if (MOD_IN_USE)
+ printk("ne: device busy, remove delayed\n");
+ else
+ {
+ unregister_filesystem(&msdos_fs_type);
+ /* This is not clear why the floppy drivers does not initialise */
+ /* the table, but we left it the way we saw it first */
+ blksize_size[FLOPPY_MAJOR] = NULL;
+ }
+ }
+
+ #endif
+
diff -rc2P linux.1.1.57/fs/msdos/misc.c linux/fs/msdos/misc.c
*** linux.1.1.57/fs/msdos/misc.c Sat Oct 29 01:13:55 1994
--- linux/fs/msdos/misc.c Thu Oct 27 23:25:27 1994
***************
*** 13,16 ****
--- 13,18 ----
#include <linux/stat.h>
+
+ #define PRINTK(x)
/* Well-known binary file extensions */
***************
*** 110,116 ****
int msdos_add_cluster(struct inode *inode)
{
! int count,nr,limit,last,current,sector;
! void *data;
struct buffer_head *bh;
if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
--- 112,118 ----
int msdos_add_cluster(struct inode *inode)
{
! int count,nr,limit,last,current,sector,last_sector;
struct buffer_head *bh;
+ int cluster_size = MSDOS_SB(inode->i_sb)->cluster_size;
if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
***************
*** 162,190 ****
if (last) printk("next set to %d\n",fat_access(inode->i_sb,last,-1));
#endif
! for (current = 0; current < MSDOS_SB(inode->i_sb)->cluster_size;
! current++) {
! sector = MSDOS_SB(inode->i_sb)->data_start+(nr-2)*
! MSDOS_SB(inode->i_sb)->cluster_size+current;
! #ifdef DEBUG
! printk("zeroing sector %d\n",sector);
! #endif
! if (current < MSDOS_SB(inode->i_sb)->cluster_size-1 &&
! !(sector & 1)) {
! if (!(bh = getblk(inode->i_dev,sector >> 1,
! BLOCK_SIZE)))
! printk("getblk failed\n");
! else {
! memset(bh->b_data,0,BLOCK_SIZE);
! bh->b_uptodate = 1;
! }
! current++;
! }
else {
! if (!(bh = msdos_sread(inode->i_dev,sector,
! &data)))
! printk("msdos_sread failed\n");
! else memset(data,0,SECTOR_SIZE);
! }
! if (bh) {
mark_buffer_dirty(bh, 1);
brelse(bh);
--- 164,178 ----
if (last) printk("next set to %d\n",fat_access(inode->i_sb,last,-1));
#endif
! sector = MSDOS_SB(inode->i_sb)->data_start+(nr-2)*cluster_size;
! last_sector = sector + cluster_size;
! for ( ; sector < last_sector; sector++) {
! #ifdef DEBUG
! printk("zeroing sector %d\n",sector);
! #endif
! if (!(bh = getblk(inode->i_dev,sector,SECTOR_SIZE)))
! printk("getblk failed\n");
else {
! memset(bh->b_data,0,SECTOR_SIZE);
! bh->b_uptodate = 1;
mark_buffer_dirty(bh, 1);
brelse(bh);
***************
*** 191,195 ****
}
}
! inode->i_blocks += MSDOS_SB(inode->i_sb)->cluster_size;
if (S_ISDIR(inode->i_mode)) {
if (inode->i_size & (SECTOR_SIZE-1)) {
--- 179,183 ----
}
}
! inode->i_blocks += cluster_size;
if (S_ISDIR(inode->i_mode)) {
if (inode->i_size & (SECTOR_SIZE-1)) {
***************
*** 198,203 ****
~(SECTOR_SIZE-1);
}
! inode->i_size += SECTOR_SIZE*MSDOS_SB(inode->i_sb)->
! cluster_size;
#ifdef DEBUG
printk("size is %d now (%x)\n",inode->i_size,inode);
--- 186,190 ----
~(SECTOR_SIZE-1);
}
! inode->i_size += SECTOR_SIZE*cluster_size;
#ifdef DEBUG
printk("size is %d now (%x)\n",inode->i_size,inode);
***************
*** 274,279 ****
--- 261,268 ----
while (1) {
offset = *pos;
+ PRINTK (("get_entry offset %d\n",offset));
if ((sector = msdos_smap(dir,offset >> SECTOR_BITS)) == -1)
return -1;
+ PRINTK (("get_entry sector %d %p\n",sector,*bh));
if (!sector)
return -1; /* beyond EOF */
***************
*** 281,284 ****
--- 270,274 ----
if (*bh)
brelse(*bh);
+ PRINTK (("get_entry sector apres brelse\n"));
if (!(*bh = msdos_sread(dir->i_dev,sector,&data))) {
printk("Directory sread (sector %d) failed\n",sector);
***************
*** 285,288 ****
--- 275,279 ----
continue;
}
+ PRINTK (("get_entry apres sread\n"));
*de = (struct msdos_dir_entry *) (data+(offset &
(SECTOR_SIZE-1)));
Only in linux.1.1.57/fs/msdos: mmap.c
diff -rc2P linux.1.1.57/fs/msdos/namei.c linux/fs/msdos/namei.c
*** linux.1.1.57/fs/msdos/namei.c Sat Oct 29 01:13:55 1994
--- linux/fs/msdos/namei.c Tue Oct 25 22:12:48 1994
***************
*** 14,17 ****
--- 14,19 ----
#include <linux/stat.h>
+ #define PRINTK(x)
+
/* MS-DOS "device special files" */
***************
*** 110,113 ****
--- 112,117 ----
struct buffer_head *bh;
struct inode *next;
+
+ PRINTK (("msdos_lookup\n"));
*result = NULL;
***************
*** 117,120 ****
--- 121,125 ----
return -ENOENT;
}
+ PRINTK (("msdos_lookup 2\n"));
if (len == 1 && name[0] == '.') {
*result = dir;
***************
*** 128,131 ****
--- 133,137 ----
return 0;
}
+ PRINTK (("msdos_lookup 3\n"));
if ((res = msdos_find(dir,name,len,&bh,&de,&ino)) < 0) {
iput(dir);
***************
*** 132,136 ****
--- 138,144 ----
return res;
}
+ PRINTK (("msdos_lookup 4\n"));
if (bh) brelse(bh);
+ PRINTK (("msdos_lookup 4.5\n"));
/* printk("lookup: ino=%d\n",ino); */
if (!(*result = iget(dir->i_sb,ino))) {
***************
*** 138,141 ****
--- 146,150 ----
return -EACCES;
}
+ PRINTK (("msdos_lookup 5\n"));
if (MSDOS_I(*result)->i_busy) { /* mkdir in progress */
iput(*result);
***************
*** 143,146 ****
--- 152,156 ----
return -ENOENT;
}
+ PRINTK (("msdos_lookup 6\n"));
while (MSDOS_I(*result)->i_old) {
next = MSDOS_I(*result)->i_old;
***************
*** 152,156 ****
--- 162,168 ----
}
}
+ PRINTK (("msdos_lookup 7\n"));
iput(dir);
+ PRINTK (("msdos_lookup 8\n"));
return 0;
}
diff -rc2P linux.1.1.57/fs/umsdos/Makefile linux/fs/umsdos/Makefile
*** linux.1.1.57/fs/umsdos/Makefile Sun Jul 24 10:39:44 1994
--- linux/fs/umsdos/Makefile Mon Oct 24 23:16:36 1994
***************
*** 8,11 ****
--- 8,15 ----
# Note 2! The CFLAGS definitions are now in the main makefile...
+ ifndef CONFIG_UMSDOS_FS
+ CFLAGS := $(CFLAGS) -DMODULE
+ endif
+
.c.s:
$(CC) $(CFLAGS) -S $<
diff -rc2P linux.1.1.57/fs/umsdos/dir.c linux/fs/umsdos/dir.c
*** linux.1.1.57/fs/umsdos/dir.c Wed Aug 10 12:26:28 1994
--- linux/fs/umsdos/dir.c Fri Oct 28 23:49:10 1994
***************
*** 351,354 ****
--- 351,355 ----
/* This is a DOS directory */
struct file filp;
+ filp.f_reada = 1;
filp.f_pos = 0;
while (1){
***************
*** 371,374 ****
--- 372,376 ----
/* skip . and .. see umsdos_readdir_x() */
struct file filp;
+ filp.f_reada = 1;
filp.f_pos = UMSDOS_SPECIAL_DIRFPOS;
while (1){
***************
*** 624,627 ****
--- 626,630 ----
}else{
struct file filp;
+ filp.f_reada = 1;
filp.f_pos = 0;
PRINTK (("hlink2inode "));
diff -rc2P linux.1.1.57/fs/umsdos/emd.c linux/fs/umsdos/emd.c
*** linux.1.1.57/fs/umsdos/emd.c Wed Aug 10 12:26:28 1994
--- linux/fs/umsdos/emd.c Fri Oct 28 23:52:35 1994
***************
*** 198,201 ****
--- 198,202 ----
}
filp.f_pos = info->f_pos;
+ filp.f_reada = 0;
ret = umsdos_emd_dir_write(emd_dir,&filp,(char*)entry,info->recsize);
if (ret != 0){
***************
*** 297,300 ****
--- 298,302 ----
buf.size = 0;
buf.filp.f_pos = 0;
+ buf.filp.f_reada = 1;
empty.found = 0;
empty.posok = emd_dir->i_size;
***************
*** 455,458 ****
--- 457,461 ----
/* Find an empty slot */
filp.f_pos = 0;
+ filp.f_reada = 1;
filp.f_flags = O_RDONLY;
ret = 1;
diff -rc2P linux.1.1.57/fs/umsdos/file.c linux/fs/umsdos/file.c
*** linux.1.1.57/fs/umsdos/file.c Sat Oct 29 01:15:54 1994
--- linux/fs/umsdos/file.c Tue Oct 25 22:15:27 1994
***************
*** 76,80 ****
NULL, /* select - default */
NULL, /* ioctl - default */
! msdos_mmap, /* mmap */
NULL, /* no special open is needed */
NULL, /* release */
--- 76,80 ----
NULL, /* select - default */
NULL, /* ioctl - default */
! generic_mmap, /* mmap */
NULL, /* no special open is needed */
NULL, /* release */
diff -rc2P linux.1.1.57/fs/umsdos/inode.c linux/fs/umsdos/inode.c
*** linux.1.1.57/fs/umsdos/inode.c Sat Oct 29 01:14:51 1994
--- linux/fs/umsdos/inode.c Thu Oct 27 02:10:43 1994
***************
*** 19,22 ****
--- 19,27 ----
#include <linux/umsdos_fs.h>
+ #ifdef MODULE
+ #include <linux/module.h>
+ #include "../../tools/version.h"
+ #endif
+
struct inode *pseudo_root=NULL; /* Useful to simulate the pseudo DOS */
/* directory. See UMSDOS_readdir_x() */
***************
*** 49,52 ****
--- 54,60 ----
{
msdos_put_super(sb);
+ #ifdef MODULE
+ MOD_DEC_USE_COUNT;
+ #endif
}
***************
*** 396,400 ****
*/
struct super_block *sb = msdos_read_super(s,data,silent);
! printk ("UMSDOS Alpha 0.4 (compatibility level %d.%d)\n"
,UMSDOS_VERSION,UMSDOS_RELEASE);
if (sb != NULL){
--- 404,408 ----
*/
struct super_block *sb = msdos_read_super(s,data,silent);
! printk ("UMSDOS Alpha 0.5 (compatibility level %d.%d, fast msdos)\n"
,UMSDOS_VERSION,UMSDOS_RELEASE);
if (sb != NULL){
***************
*** 464,467 ****
--- 472,478 ----
iput (pseudo);
}
+ #ifdef MODULE
+ MOD_INC_USE_COUNT;
+ #endif
}
return sb;
***************
*** 468,470 ****
--- 479,507 ----
}
+
+ #ifdef MODULE
+
+ char kernel_version[] = UTS_RELEASE;
+
+ static struct file_system_type umsdos_fs_type = {
+ UMSDOS_read_super, "umsdos", 1, NULL
+ };
+
+ int init_module(void)
+ {
+ register_filesystem(&umsdos_fs_type);
+ return 0;
+ }
+
+ void cleanup_module(void)
+ {
+ if (MOD_IN_USE)
+ printk("Umsdos: file system in use, remove delayed\n");
+ else
+ {
+ unregister_filesystem(&umsdos_fs_type);
+ }
+ }
+
+ #endif
diff -rc2P linux.1.1.57/fs/umsdos/symlink.c linux/fs/umsdos/symlink.c
*** linux.1.1.57/fs/umsdos/symlink.c Wed Aug 10 12:26:28 1994
--- linux/fs/umsdos/symlink.c Fri Oct 28 23:53:46 1994
***************
*** 35,38 ****
--- 35,39 ----
struct file filp;
filp.f_pos = 0;
+ filp.f_reada = 0;
if (ret > bufsiz) ret = bufsiz;
if ((*msdos_read) (inode, &filp, buffer,ret) != ret){
diff -rc2P linux.1.1.57/include/linux/msdos_fs.h linux/include/linux/msdos_fs.h
*** linux.1.1.57/include/linux/msdos_fs.h Sat Oct 29 01:14:52 1994
--- linux/include/linux/msdos_fs.h Mon Oct 24 23:16:36 1994
***************
*** 12,17 ****
#define SECTOR_SIZE 512 /* sector size (bytes) */
#define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */
! #define MSDOS_DPB (MSDOS_DPS*2) /* dir entries per block */
! #define MSDOS_DPB_BITS 5 /* log2(MSDOS_DPB) */
#define MSDOS_DPS (SECTOR_SIZE/sizeof(struct msdos_dir_entry))
#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
--- 12,17 ----
#define SECTOR_SIZE 512 /* sector size (bytes) */
#define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */
! #define MSDOS_DPB (MSDOS_DPS) /* dir entries per block */
! #define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */
#define MSDOS_DPS (SECTOR_SIZE/sizeof(struct msdos_dir_entry))
#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
***************
*** 113,121 ****
static inline struct buffer_head *msdos_sread(int dev,int sector,void **start)
{
! struct buffer_head *bh;
!
! if (!(bh = bread(dev,sector >> 1, 1024)))
! return NULL;
! *start = bh->b_data+((sector & 1) << SECTOR_BITS);
return bh;
}
--- 113,120 ----
static inline struct buffer_head *msdos_sread(int dev,int sector,void **start)
{
! struct buffer_head *bh = bread(dev,sector, 512);
! if (bh != NULL){
! *start = bh->b_data; /* From the time of 1024 bytes block */
! }
return bh;
}
diff -rc2P linux.1.1.57/kernel/ksyms.c linux/kernel/ksyms.c
*** linux.1.1.57/kernel/ksyms.c Sat Oct 29 01:14:47 1994
--- linux/kernel/ksyms.c Sat Oct 29 00:43:56 1994
***************
*** 28,31 ****
--- 28,32 ----
#include <linux/tty.h>
#include <linux/serial.h>
+ #include <linux/locks.h>
#ifdef CONFIG_INET
#include <linux/net.h>
***************
*** 45,48 ****
--- 46,51 ----
#endif
+ extern int sys_tz;
+ extern int ___strtok;
extern int request_dma(unsigned int dmanr, char * deviceID);
extern void free_dma(unsigned int dmanr);
***************
*** 200,204 ****
X(dev_base),
#endif
!
/********************************************************
* Do not add anything below this line,
--- 203,229 ----
X(dev_base),
#endif
! /* Added to make file system as module */
! X(set_writetime),
! X(getblk),
! X(inode_setattr),
! X(sys_tz),
! X(inode_change_ok),
! X(__wait_on_super),
! X(file_fsync),
! X(simple_strtoul),
! X(generic_mmap),
! X(set_blocksize),
! X(clear_inode),
! X(refile_buffer),
! X(___strtok),
! X(brelse),
! X(bread),
! X(init_fifo),
! X(super_blocks),
! X(chrdev_inode_operations),
! X(blkdev_inode_operations),
! X(ll_rw_block),
! X(__wait_on_buffer),
! X(read_ahead),
/********************************************************
* Do not add anything below this line,