[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-09-24 19:00:19
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10952/drivers/native Modified Files: fs_native.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_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -w -b -B -p -r1.64 -r1.65 --- fs_native.c 20 Aug 2007 19:37:05 -0000 1.64 +++ fs_native.c 24 Sep 2007 19:00:03 -0000 1.65 @@ -378,8 +378,6 @@ create_internal_namespace(const void *da int err; struct mount *mnt; struct inode *rootino; - struct pnode_base *rootpb; - static struct qstr noname = { NULL, 0, 0 }; struct filesys *fs; time_t t; struct intnl_stat stbuf; @@ -424,7 +422,6 @@ create_internal_namespace(const void *da fs = NULL; mnt = NULL; rootino = NULL; - rootpb = NULL; /* * This really should be per-mount. Hmm, but that's best done * as proper sub-mounts in the core and not this driver. We reconcile @@ -463,19 +460,10 @@ create_internal_namespace(const void *da } /* - * 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; @@ -487,11 +475,8 @@ error: abort(); nfs = NULL; fs = NULL; - rootpb = NULL; rootino = NULL; } - if (rootpb) - _sysio_pb_gone(rootpb); if (fs) { FS_RELE(fs); nfs = NULL; |