Fixes to ISOFS

This commit is contained in:
Thomas Veerman 2009-10-01 14:34:17 +00:00
parent 471ad9384f
commit cb6f6a94f7
6 changed files with 38 additions and 22 deletions

View file

@ -281,6 +281,21 @@ driver mfs
uid 0;
};
driver isofs
{
system
TIMES # 25
SAFECOPYFROM # 31
SAFECOPYTO # 32
GETINFO
SETGRANT # 34
UMAP # 14
PROFBUF # 38
SYSCTL
;
uid 0;
};
driver printer
{
io 378:4 # LPT1

View file

@ -18,6 +18,7 @@ all install depend clean:
cd ./pm && $(MAKE) $@
cd ./vfs && $(MAKE) $@
cd ./mfs && $(MAKE) $@
cd ./iso9660fs && $(MAKE) $@
cd ./rs && $(MAKE) $@
cd ./ds && $(MAKE) $@
cd ./is && $(MAKE) $@

View file

@ -29,20 +29,6 @@ PUBLIC int main(void) {
return -1;
}
#if 0
if (fs_m_in.m_type != REQ_READSUPER_O && fs_m_in.m_type != REQ_READSUPER_S) {
printf("ISO9660FS(%d): Invalid login reply\n", SELF_E);
return -1;
} else {
if (fs_m_in.m_type == REQ_READSUPER_S)
fs_m_out.m_type = fs_readsuper_s();
else
fs_m_out.m_type = fs_readsuper();
reply(FS_PROC_NR, &fs_m_out);
if (fs_m_out.m_type != OK) return -1;
}
#endif
for (;;) {
/* Wait for request message. */
@ -69,8 +55,6 @@ PUBLIC int main(void) {
ind= req_nr-VFS_BASE;
if (ind < 0 || ind >= NREQS) {
printf("iso9660fs: bad request %d\n", req_nr);
printf("ind = %d\n", ind);
error = EINVAL;
}
else
@ -79,7 +63,6 @@ PUBLIC int main(void) {
fs_m_out.m_type = error;
reply(who_e, &fs_m_out); /* returns the response to VFS */
}
}

View file

@ -11,6 +11,7 @@ int fs_sync(void);
int lookup(void);
int fs_access(void);
int fs_getdents(void);
int fs_getdents_o(void);
/* main.c */
_PROTOTYPE( int main, (void) );

View file

@ -269,7 +269,6 @@ PUBLIC int fs_getdents(void) {
dir_tmp = get_free_dir_record();
create_dir_record(dir_tmp,bp->b_data + block_pos,
block*block_size + block_pos);
if (dir_tmp->length == 0) { /* EOF. I exit and return 0s */
block_pos = block_size;
done = TRUE;
@ -316,7 +315,6 @@ PUBLIC int fs_getdents(void) {
if (tmpbuf_offset + reclen > GETDENTS_BUFSIZ) {
r= sys_safecopyto(FS_PROC_NR, gid, userbuf_off,
(vir_bytes)getdents_buf, tmpbuf_offset, D);
if (r != OK)
panic(__FILE__,"fs_getdents: sys_safecopyto failed\n",r);
@ -348,7 +346,6 @@ PUBLIC int fs_getdents(void) {
block++; /* read the next one */
}
if (tmpbuf_offset != 0) {
r= sys_safecopyto(FS_PROC_NR, gid, userbuf_off,
(vir_bytes)getdents_buf, tmpbuf_offset, D);
@ -361,11 +358,28 @@ PUBLIC int fs_getdents(void) {
r= ENOSYS;
fs_m_out.RES_GDE_POS_CHANGE= 0; /* No change in case of an error */
r= userbuf_off;
/* r= userbuf_off;*/
fs_m_out.RES_GDE_CUM_IO = userbuf_off;
if (cur_pos >= pos)
fs_m_out.RES_GDE_POS_CHANGE= cur_pos-pos;
else
fs_m_out.RES_GDE_POS_CHANGE= 0;
release_dir_record(dir); /* release the inode */
r= OK;
return(r);
}
/*===========================================================================*
* fs_getdents_s *
*===========================================================================*/
PUBLIC int fs_getdents_o(void)
{
int r;
r = fs_getdents();
if(r == OK)
r = fs_m_out.RES_GDE_CUM_IO;
return(r);
}

View file

@ -48,7 +48,7 @@ PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = {
fs_new_driver, /* 37 */
fs_bread, /* 38 */
no_sys, /* 39 */
fs_getdents, /* 40 */
fs_getdents_o, /* 40 */
no_sys, /* 41: not_used */
fs_read_s, /* 42 */
no_sys, /* 43: not used */
@ -61,4 +61,6 @@ PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = {
fs_mountpoint_s, /* 50 */
fs_readsuper_s, /* 51 */
no_sys, /* 52: not used */
no_sys, /* 53 */
fs_getdents, /* 54 */
};