[BACK]Return to puffs_msgif.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / fs / puffs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/fs/puffs/puffs_msgif.c between version 1.51.2.2 and 1.51.2.3

version 1.51.2.2, 2007/12/08 18:20:17 version 1.51.2.3, 2008/02/18 21:06:39
Line 33 
Line 33 
 __KERNEL_RCSID(0, "$NetBSD$");  __KERNEL_RCSID(0, "$NetBSD$");
   
 #include <sys/param.h>  #include <sys/param.h>
   #include <sys/atomic.h>
 #include <sys/fstrans.h>  #include <sys/fstrans.h>
 #include <sys/kmem.h>  #include <sys/kmem.h>
 #include <sys/kthread.h>  #include <sys/kthread.h>
Line 276  puffs_msg_setdelta(struct puffs_msgpark 
Line 277  puffs_msg_setdelta(struct puffs_msgpark 
 }  }
   
 void  void
 puffs_msg_setinfo(struct puffs_msgpark *park, int class, int type, void *cookie)  puffs_msg_setinfo(struct puffs_msgpark *park, int class, int type,
           puffs_cookie_t ck)
 {  {
   
         park->park_preq->preq_opclass = PUFFSOP_OPCLASS(class);          park->park_preq->preq_opclass = PUFFSOP_OPCLASS(class);
         park->park_preq->preq_optype = type;          park->park_preq->preq_optype = type;
         park->park_preq->preq_cookie = cookie;          park->park_preq->preq_cookie = ck;
 }  }
   
 void  void
Line 562  puffs_msg_sendresp(struct puffs_mount *p
Line 564  puffs_msg_sendresp(struct puffs_mount *p
         struct puffs_msgpark *park;          struct puffs_msgpark *park;
         struct puffs_req *preq;          struct puffs_req *preq;
   
         puffs_msgmem_alloc(sizeof(struct puffs_req), &park, (void **)&preq, 1);          puffs_msgmem_alloc(sizeof(struct puffs_req), &park, (void *)&preq, 1);
         puffs_msg_setfaf(park); /* XXXXXX: avoids reqid override */          puffs_msg_setfaf(park); /* XXXXXX: avoids reqid override */
   
         memcpy(preq, origpreq, sizeof(struct puffs_req));          memcpy(preq, origpreq, sizeof(struct puffs_req));
Line 927  puffsop_flush(struct puffs_mount *pmp, s
Line 929  puffsop_flush(struct puffs_mount *pmp, s
                         break;                          break;
                 }                  }
   
                 simple_lock(&vp->v_uobj.vmobjlock);                  mutex_enter(&vp->v_uobj.vmobjlock);
                 rv = VOP_PUTPAGES(vp, offlo, offhi, flags);                  rv = VOP_PUTPAGES(vp, offlo, offhi, flags);
                 break;                  break;
   
Line 981  puffs_msgif_close(void *this)
Line 983  puffs_msgif_close(void *this)
 {  {
         struct puffs_mount *pmp = this;          struct puffs_mount *pmp = this;
         struct mount *mp = PMPTOMP(pmp);          struct mount *mp = PMPTOMP(pmp);
         int gone, rv;          int rv;
   
         mutex_enter(&pmp->pmp_lock);          mutex_enter(&pmp->pmp_lock);
         puffs_mp_reference(pmp);          puffs_mp_reference(pmp);
Line 991  puffs_msgif_close(void *this)
Line 993  puffs_msgif_close(void *this)
          * The syncer might be jogging around in this file system           * The syncer might be jogging around in this file system
          * currently.  If we allow it to go to the userspace of no           * currently.  If we allow it to go to the userspace of no
          * return while trying to get the syncer lock, well ...           * return while trying to get the syncer lock, well ...
          * synclk: I feel happy, I feel fine.  
          * lockmgr: You're not fooling anyone, you know.  
          */           */
         puffs_userdead(pmp);          puffs_userdead(pmp);
   
Line 1032  puffs_msgif_close(void *this)
Line 1032  puffs_msgif_close(void *this)
          * wait for syncer_mutex.  Otherwise the mointpoint can be           * wait for syncer_mutex.  Otherwise the mointpoint can be
          * wiped out while we wait.           * wiped out while we wait.
          */           */
         simple_lock(&mp->mnt_slock);          atomic_inc_uint((unsigned int*)&mp->mnt_refcnt);
         mp->mnt_wcnt++;  
         simple_unlock(&mp->mnt_slock);  
   
         mutex_enter(&syncer_mutex);          mutex_enter(&syncer_mutex);
           if (mp->mnt_iflag & IMNT_GONE) {
         simple_lock(&mp->mnt_slock);  
         mp->mnt_wcnt--;  
         if (mp->mnt_wcnt == 0)  
                 wakeup(&mp->mnt_wcnt);  
         gone = mp->mnt_iflag & IMNT_GONE;  
         simple_unlock(&mp->mnt_slock);  
         if (gone) {  
                 mutex_exit(&syncer_mutex);                  mutex_exit(&syncer_mutex);
                   vfs_destroy(mp);
                 return 0;                  return 0;
         }          }
   
Line 1060  puffs_msgif_close(void *this)
Line 1051  puffs_msgif_close(void *this)
          * is already a goner.           * is already a goner.
          * XXX: skating on the thin ice of modern calling conventions ...           * XXX: skating on the thin ice of modern calling conventions ...
          */           */
         if (vfs_busy(mp, 0, 0)) {          if (vfs_busy(mp, RW_WRITER, NULL)) {
                 mutex_exit(&syncer_mutex);                  mutex_exit(&syncer_mutex);
                   vfs_destroy(mp);
                 return 0;                  return 0;
         }          }
   
Line 1072  puffs_msgif_close(void *this)
Line 1064  puffs_msgif_close(void *this)
          */           */
         rv = dounmount(mp, MNT_FORCE, curlwp);          rv = dounmount(mp, MNT_FORCE, curlwp);
         KASSERT(rv == 0);          KASSERT(rv == 0);
           vfs_destroy(mp);
   
         return 0;          return 0;
 }  }

Legend:
Removed from v.1.51.2.2  
changed lines
  Added in v.1.51.2.3

CVSweb <webmaster@jp.NetBSD.org>