From: Thomas Veerman Date: Thu, 1 Oct 2009 14:34:17 +0000 (+0000) Subject: Fixes to ISOFS X-Git-Tag: v3.1.5~52 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=cb6f6a94f73b22a705cb59db58c91a8d89a93373;p=minix.git Fixes to ISOFS --- diff --git a/etc/drivers.conf b/etc/drivers.conf index 2e7b6639b..06fce3c38 100644 --- a/etc/drivers.conf +++ b/etc/drivers.conf @@ -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 diff --git a/servers/Makefile b/servers/Makefile index 6b8191ba8..0a232e78e 100644 --- a/servers/Makefile +++ b/servers/Makefile @@ -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) $@ diff --git a/servers/iso9660fs/main.c b/servers/iso9660fs/main.c index b41b79e36..aaac8f533 100644 --- a/servers/iso9660fs/main.c +++ b/servers/iso9660fs/main.c @@ -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 */ - } } diff --git a/servers/iso9660fs/proto.h b/servers/iso9660fs/proto.h index a4410180d..cf4be130c 100644 --- a/servers/iso9660fs/proto.h +++ b/servers/iso9660fs/proto.h @@ -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) ); diff --git a/servers/iso9660fs/read.c b/servers/iso9660fs/read.c index 480bd27f8..1df3c3c1e 100644 --- a/servers/iso9660fs/read.c +++ b/servers/iso9660fs/read.c @@ -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); } diff --git a/servers/iso9660fs/table.c b/servers/iso9660fs/table.c index 86d84c302..690aedb0e 100644 --- a/servers/iso9660fs/table.c +++ b/servers/iso9660fs/table.c @@ -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 */ };