[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2008-06-17 17:19:10
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12543/drivers/native Modified Files: fs_native.c Log Message: Begin adding support for thread-safe operation. In detail: 1) Add smp.h and smp_posix.c 2) Add a big lock, wrapping the user API with appropriate mutex_lock and mutex_unlock calls. NB; initialization is *not* thread safe. 3) Add support for P_{GET,LOCK}, PB_LOCK, I_{GET,LOCK}, FIL_{GET,LOCK} and alter all related ref/de-ref usage to use get/put or lock/unlock as appropriate. 4) Remedial (no-op) support for MNT_GET. By default, POSIX threads supoprt is not enabled. To enable, use --with-threads, or --with-threads=yes, or --with-threads=posix. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -w -b -B -p -r1.65 -r1.66 --- fs_native.c 24 Sep 2007 19:00:03 -0000 1.65 +++ fs_native.c 17 Jun 2008 17:18:57 -0000 1.66 @@ -466,17 +466,19 @@ create_internal_namespace(const void *da err = _sysio_mounti(fs, rootino, 0, NULL, &mnt); if (err) goto error; - + I_PUT(rootino); /* drop ours */ native_internal_mount = mnt; return 0; error: if (mnt) { if (_sysio_do_unmount(mnt) != 0) abort(); - nfs = NULL; - fs = NULL; rootino = NULL; + fs = NULL; + nfs = NULL; } + if (rootino) + I_RELE(rootino); if (fs) { FS_RELE(fs); nfs = NULL; @@ -537,7 +539,7 @@ native_fsswop_mount(const char *source, * aliases we might have generated. We really don't need to cache them * as they are only used at mount time.. */ - P_RELE(nameidata.nd_pno); + P_PUT(nameidata.nd_pno); (void )_sysio_p_prune(native_internal_mount->mnt_root); if (!err) { |