PERFORCE change 195718 for review
Ilya Putsikau
ilya at FreeBSD.org
Mon Jul 4 16:27:38 UTC 2011
http://p4web.freebsd.org/@@195718?ac=10
Change 195718 by ilya at ilya_triton2011 on 2011/07/04 16:27:16
Mark FUSE MPSAFE.
Remove file create serialization.
Affected files ...
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#13 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#13 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#17 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#34 edit
Differences ...
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#13 (text+ko) ====
@@ -56,9 +56,6 @@
}
vp->v_type = vtyp;
vp->v_data = fvdat;
- fvdat->create_owner = curthread->td_tid;
- cv_init(&fvdat->create_cv, "fuse node create cv");
- sx_init(&fvdat->create_lock, "fuse node create lock");
sx_init(&fvdat->nodelock, "fuse node sx lock");
sx_init(&fvdat->truncatelock, "fuse node truncate sx lock");
@@ -74,8 +71,6 @@
struct fuse_vnode_data *fvdat = vp->v_data;
vp->v_data = NULL;
- cv_destroy(&fvdat->create_cv);
- sx_destroy(&fvdat->create_lock);
sx_destroy(&fvdat->nodelock);
sx_destroy(&fvdat->truncatelock);
free(fvdat, M_FUSEVN);
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#13 (text+ko) ====
@@ -39,12 +39,6 @@
uint64_t nlookup;
enum vtype vtype;
- /** locking **/
-
- struct sx create_lock;
- struct cv create_cv;
- lwpid_t create_owner;
-
/*
* The nodelock must be held when data in the FUSE node is accessed or
* modified. Typically, we would take this lock at the beginning of a
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#17 (text+ko) ====
@@ -248,9 +248,7 @@
vfs_getnewfsid(mp);
mp->mnt_flag |= MNT_LOCAL;
-#ifdef XXXIP
mp->mnt_kern_flag |= MNTK_MPSAFE;
-#endif
if (subtype) {
strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN);
strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN);
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#34 (text+ko) ====
@@ -1188,36 +1188,6 @@
fufh_type = fuse_filehandle_xlate_from_fflags(mode);
}
- if (!isdir && (fvdat->flag & FN_CREATING)) {
-
- sx_xlock(&fvdat->create_lock);
-
- if (fvdat->flag & FN_CREATING) { // check again
- if (fvdat->create_owner == curthread->td_tid) {
- fufh_type = FUFH_RDWR;
- MPASS(fuse_filehandle_valid(vp, fufh_type));
- fvdat->flag &= ~FN_CREATING;
- sx_xunlock(&fvdat->create_lock);
- cv_broadcast(&fvdat->create_cv); // wake up all
- return 0;
- } else {
- debug_printf("contender going to sleep\n");
- error = cv_wait_sig(&fvdat->create_cv, &fvdat->create_lock);
- debug_printf("contender awake (error = %d)\n", error);
- if (error) {
- /*
- * We'll be woken up in case a signal arrives.
- * The value of error could be EINTR or ERESTART.
- */
- return error;
- }
- }
- } else {
- sx_xunlock(&fvdat->create_lock);
- /* Can proceed from here. */
- }
- }
-
if (fuse_filehandle_valid(vp, fufh_type)) {
fuse_vnode_open(vp, 0, td);
return 0;
More information about the p4-projects
mailing list