[Libsysio-commit] HEAD: libsysio/drivers/yod fs_yod.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-09-24 19:00:19
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10952/drivers/yod Modified Files: fs_yod.c Log Message: All the drivers, in their mount routines, do something like: rootpb = _sysio_pb_new(&noname, NULL, rootino); err = _sysio_do_mount(..., rootpb, ...); This is clumsy. Crafted a convenience function called _sysio_mounti to do this for them. This simplifies the whole process a bit. Don't have to clean up the root pb node on error, for instance. The function is called exactly like _sysio_do_mount but with a ptr to the root inode instead of a ptr to the root pb node. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- fs_yod.c 4 Aug 2005 20:17:10 -0000 1.22 +++ fs_yod.c 24 Sep 2007 19:00:03 -0000 1.23 @@ -343,8 +343,6 @@ create_internal_namespace() int err; struct mount *mnt; struct inode *rootino; - struct pnode_base *rootpb; - static struct qstr noname = { NULL, 0, 0 }; struct filesys *fs; struct intnl_stat stbuf; @@ -362,7 +360,6 @@ create_internal_namespace() */ mnt = NULL; rootino = NULL; - rootpb = NULL; fs = _sysio_fs_new(&yod_inodesys_ops, 0, NULL); if (!fs) { err = -ENOMEM; @@ -382,19 +379,10 @@ create_internal_namespace() } /* - * Generate base path-node for root. - */ - rootpb = _sysio_pb_new(&noname, NULL, rootino); - if (!rootpb) { - err = -ENOMEM; - goto error; - } - - /* * Mount it. This name space is disconnected from the * rest of the system -- Only available within this driver. */ - err = _sysio_do_mount(fs, rootpb, 0, NULL, &mnt); + err = _sysio_mounti(fs, rootino, 0, NULL, &mnt); if (err) goto error; @@ -405,11 +393,8 @@ error: if (_sysio_do_unmount(mnt) != 0) abort(); fs = NULL; - rootpb = NULL; rootino = NULL; } - if (rootpb) - _sysio_pb_gone(rootpb); if (fs) { FS_RELE(fs); } |