diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index c84b740..4f2a397 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -43,7 +43,25 @@ int devfs_init() { //Add DevFS i will - if (vfsRegisterFS(1,devFSInit,devFSRead,devFSWrite,devFSOpen,0x0,0x0,0x0,0x0) != 0x0) { + + struct fileSystem devFS = + {NULL, /* prev */ + NULL, /* next */ + (void *)devFSInit, /* vfsInitFS */ + (void *)devFSRead, /* vfsRead */ + (void *)devFSWrite, /* vfsWrite */ + (void *)devFSOpen, /* vfsOpenFile */ + NULL, /* vfsUnlink */ + NULL, /* vfsMakeDir */ + NULL, /* vfsRemDir */ + NULL, /* vfsSync */ + 1 /* vfsType */ + }; /* devFS */ + +/* mji + * if (vfsRegisterFS(1,devFSInit,devFSRead,devFSWrite,devFSOpen,0x0,0x0,0x0,0x0) != 0x0) { + */ + if (vfsRegisterFS(devFS) != 0x0) { //sysErr(systemErr,"Unable To Enable DevFS"); return(0x1); } @@ -194,6 +212,10 @@ /*** $Log$ + Revision 1.11 2004/07/14 12:17:52 reddawg + devfs: devFSEnable to devfs_init + Changed Startup Routines + Revision 1.10 2004/06/28 23:12:58 reddawg file format now container:/path/to/file diff --git a/src/sys/include/vfs/vfs.h b/src/sys/include/vfs/vfs.h index 9d72a98..0d899fb 100644 --- a/src/sys/include/vfs/vfs.h +++ b/src/sys/include/vfs/vfs.h @@ -71,7 +71,11 @@ /* VFS Functions */ int vfs_init(); -int vfsRegisterFS(int,void *,void *,void *,void *,void *,void *,void *,void *); +/* + *int vfsRegisterFS(int,void *,void *,void *,void *,void *,void *,void *,void *); +*/ +int vfsRegisterFS(struct fileSystem); + struct fileSystem *vfsFindFS(int); diff --git a/src/sys/ubixfs/directory.c b/src/sys/ubixfs/directory.c index d7f618e..7d5843b 100644 --- a/src/sys/ubixfs/directory.c +++ b/src/sys/ubixfs/directory.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.8 2004/06/29 03:59:47 reddawg + Fixed a few issues with subdirectories they are working much better now + Revision 1.7 2004/06/28 23:12:58 reddawg file format now container:/path/to/file @@ -65,7 +68,8 @@ static dirList_t dirList = 0x0; -dirList_t ubixFSLoadDir(char *data) { +dirList_t +ubixFSLoadDir(char *data) { dirList_t tmpDir = 0x0; tmpDir = (dirList_t)kmalloc(sizeof(struct directoryList)); @@ -89,7 +93,8 @@ return(tmpDir); } -int addDirEntry(struct directoryEntry *dir,fileDescriptor *fd) { +int +addDirEntry(struct directoryEntry *dir,fileDescriptor *fd) { int i = 0x0; uInt32 entries = 0x0; struct directoryEntry *tmp = 0x0; @@ -116,7 +121,8 @@ return(0x0); } -int ubixFSmkDir(char *directory,fileDescriptor *fd) { +int +ubixFSmkDir(char *directory,fileDescriptor *fd) { int block = 0x0; struct directoryEntry *dir = 0x0; diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c index efc502c..53a4f1c 100644 --- a/src/sys/ubixfs/ubixfs.c +++ b/src/sys/ubixfs/ubixfs.c @@ -41,20 +41,43 @@ #include #include -int ubixfs_init() { +int +ubixfs_init() { + + struct fileSystem ubixFileSystem = + {NULL, /* prev */ + NULL, /* next */ + (void *)initUbixFS, /* vfsInitFS */ + (void *)readUbixFS, /* vfsRead */ + (void *)writeUbixFS, /* vfsWrite */ + (void *)openFileUbixFS, /* vfsOpenFile */ + (void *)ubixFSUnlink, /* vfsUnlink */ + (void *)ubixFSmkDir, /* vfsMakeDir */ + NULL, /* vfsRemDir */ + NULL, /* vfsSync */ + 0 /* vfsType */ + }; /* ubixFileSystem */ + /* Add UbixFS */ - if (vfsRegisterFS(0,initUbixFS,readUbixFS,writeUbixFS,openFileUbixFS,ubixFSUnlink,ubixFSmkDir,0x0,0x0) != 0x0) { +/* mji + * if (vfsRegisterFS(0, initUbixFS, readUbixFS, writeUbixFS, openFileUbixFS, + * ubixFSUnlink, ubixFSmkDir, 0x0, 0x0) != 0x0) { + */ + if (vfsRegisterFS(ubixFileSystem) != 0x0) { kpanic("Unable To Enable UbixFS"); return(0x1); } - /* Start Up The UbixFS Thread Which Will Manage All The Mounted UbixFS Partitions */ + /* Start Up The UbixFS Thread Which Will Manage All The Mounted + * UbixFS Partitions + */ execThread(ubixFS_Thread,(uInt32)(kmalloc(0x2000)+0x2000),0x0); /* Return */ return(0x0); } -void initUbixFS(struct mountPoints *mp) { +void +initUbixFS(struct mountPoints *mp) { struct ubixFSInfo *fsInfo = 0x0; mp->fsInfo = (struct ubixFSInfo *)kmalloc(sizeof(struct ubixFSInfo)); fsInfo = mp->fsInfo; @@ -325,6 +348,10 @@ /*** $Log$ + Revision 1.15 2004/07/14 12:21:49 reddawg + ubixfs: enableUbixFs to ubixfs_init + Changed Startup Routines + Revision 1.14 2004/06/28 23:12:58 reddawg file format now container:/path/to/file diff --git a/src/sys/ufs/ufs/ufs_vnops.c b/src/sys/ufs/ufs/ufs_vnops.c index 89d68bf..56ca91d 100644 --- a/src/sys/ufs/ufs/ufs_vnops.c +++ b/src/sys/ufs/ufs/ufs_vnops.c @@ -97,7 +97,6 @@ static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static int ufs_mkdir(struct vop_mkdir_args *); static int ufs_mknod(struct vop_mknod_args *); -static int ufs_open(struct vop_open_args *); static int ufs_pathconf(struct vop_pathconf_args *); static int ufs_print(struct vop_print_args *); static int ufs_readlink(struct vop_readlink_args *); @@ -256,30 +255,6 @@ return (0); } -/* - * Open called. - * - * Nothing to do. - */ -/* ARGSUSED */ -static int -ufs_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; -{ - - /* - * Files marked append-only must be opened for appending. - */ - if ((VTOI(ap->a_vp)->i_flags & APPEND) && - (ap->a_mode & (FWRITE | O_APPEND)) == FWRITE) - return (EPERM); - return (0); -} /* * Close called. @@ -2812,3 +2787,30 @@ return (VOCALL(ufs_specop_p, ap->a_desc->vdesc_offset, ap)); } #endif + +static int ufs_open(struct vop_open_args *); + +/* + * Open called. + * + * Nothing to do. + */ +/* ARGSUSED */ +static int +ufs_open(ap) + struct vop_open_args /* { + struct vnode *a_vp; + int a_mode; + struct ucred *a_cred; + struct thread *a_td; + } */ *ap; +{ + + /* + * Files marked append-only must be opened for appending. + */ + if ((VTOI(ap->a_vp)->i_flags & APPEND) && + (ap->a_mode & (FWRITE | O_APPEND)) == FWRITE) + return (EPERM); + return (0); +} diff --git a/src/sys/vfs/vfs.c b/src/sys/vfs/vfs.c index bb3eacb..122a830 100644 --- a/src/sys/vfs/vfs.c +++ b/src/sys/vfs/vfs.c @@ -69,8 +69,10 @@ return(0x0); } -int vfsRegisterFS(int vfsType,void *vfsInitFS,void *vfsRead,void *vfsWrite,void *vfsOpenFile,void *vfsUnlink,void *vfsMakeDir,void *vfsRemDir,void *vfsSync) { - +int vfsRegisterFS(struct fileSystem newFS) { +/* +int vfsType,void *vfsInitFS,void *vfsRead,void *vfsWrite,void *vfsOpenFile,void *vfsUnlink,void *vfsMakeDir,void *vfsRemDir,void *vfsSync) { + */ struct fileSystem *tmpFs = 0x0; /* Allocate Memory */ @@ -81,16 +83,18 @@ } /* Set Up FS Defaults */ - tmpFs->vfsType = vfsType; - tmpFs->vfsInitFS = vfsInitFS; - tmpFs->vfsRead = vfsRead; - tmpFs->vfsWrite = vfsWrite; - tmpFs->vfsOpenFile = vfsOpenFile; - tmpFs->vfsUnlink = vfsUnlink; - tmpFs->vfsMakeDir = vfsMakeDir; - tmpFs->vfsRemDir = vfsRemDir; - tmpFs->vfsSync = vfsSync; + tmpFs->vfsType = newFS.vfsType; + tmpFs->vfsInitFS = newFS.vfsInitFS; + tmpFs->vfsRead = newFS.vfsRead; + tmpFs->vfsWrite = newFS.vfsWrite; + tmpFs->vfsOpenFile = newFS.vfsOpenFile; + tmpFs->vfsUnlink = newFS.vfsUnlink; + tmpFs->vfsMakeDir = newFS.vfsMakeDir; + tmpFs->vfsRemDir = newFS.vfsRemDir; + tmpFs->vfsSync = newFS.vfsSync; + +/* memcpy(*tmpFs, newFS, sizeof(struct fileSystem)); */ if (!systemVitals->fileSystems) { tmpFs->prev = 0x0; tmpFs->next = 0x0; @@ -108,6 +112,10 @@ /*** $Log$ + Revision 1.4 2004/07/09 13:11:28 reddawg + vfs: changed vfsInit to vfs_init + Adjust startup routines + Revision 1.3 2004/05/21 14:52:39 reddawg Cleaned up