[Libsysio-commit] HEAD: libsysio/drivers/incore fs_incore.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-09-24 19:00:19
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10952/drivers/incore Modified Files: fs_incore.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_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -w -b -B -p -r1.34 -r1.35 --- fs_incore.c 21 Sep 2007 19:41:37 -0000 1.34 +++ fs_incore.c 24 Sep 2007 19:00:02 -0000 1.35 @@ -537,9 +537,7 @@ _sysio_incore_fsswop_mount(const char *s struct incore_inode *icino; struct filesys *fs; struct inode *rooti; - struct pnode_base *rootpb; struct mount *mnt; - static struct qstr noname = { NULL, 0, 0 }; /* * Source is a specification for the root attributes of this @@ -585,7 +583,6 @@ _sysio_incore_fsswop_mount(const char *s dev = _sysio_dev_alloc(); mnt = NULL; - rootpb = NULL; rooti = NULL; fs = NULL; icino = NULL; @@ -650,23 +647,13 @@ _sysio_incore_fsswop_mount(const char *s err = -ENOMEM; goto error; } - rootpb = _sysio_pb_new(&noname, NULL, rooti); - if (!rootpb) { - err = -ENOMEM; - goto error; - } /* * Have path-node specified by the given source argument. Let the * system finish the job, now. */ mnt = NULL; - err = - _sysio_do_mount(fs, - rootpb, - flags, - tocover, - &mnt); + err = _sysio_mounti(fs, rooti, flags, tocover, &mnt); if (err) goto error; @@ -677,10 +664,6 @@ _sysio_incore_fsswop_mount(const char *s error: if (mnt && _sysio_do_unmount(mnt) != 0) abort(); - if (rootpb) { - _sysio_pb_gone(rootpb); - rooti = NULL; - } if (rooti) I_RELE(rooti); if (fs) { |