~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to modules/freebsd/vmhgfs/state.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
 
102
102
/* Adding/finding/removing file state from hash table */
103
103
static void HgfsAddFile(HgfsFile *fp, HgfsFileHashTable *htp);
104
 
static void HgfsRemoveFile(HgfsFile *fp, HgfsFileHashTable *htp);
105
104
static HgfsFile *HgfsFindFile(const char *fileName, HgfsFileHashTable *htp);
106
105
 
107
106
/* Other utility functions */
680
679
         } else {
681
680
            /* vnode exists but unusable, remove HGFS context assosiated with it. */
682
681
            DEBUG(VM_DEBUG_FAIL, "Removing HgfsFile assosiated with an unusable vnode\n");
683
 
            HgfsRemoveFile(existingFp, htp);
 
682
            DblLnkLst_Unlink1(&existingFp->listNode);
684
683
            err = ENOENT;
685
684
         }
686
685
      }
1097
1096
   ASSERT(fp);
1098
1097
   ASSERT(htp);
1099
1098
 
1100
 
   os_mutex_lock(htp->mutex);
1101
 
 
1102
1099
   DEBUG(VM_DEBUG_INFO, "HgfsReleaseFile: freeing HgfsFile for %s.\n",
1103
1100
         fp->fileName);
1104
1101
   /* Take this file off its list */
 
1102
   os_mutex_lock(htp->mutex);
1105
1103
   DblLnkLst_Unlink1(&fp->listNode);
 
1104
   os_mutex_unlock(htp->mutex);
 
1105
 
1106
1106
   HgfsFreeFile(fp);
1107
 
 
1108
 
   os_mutex_unlock(htp->mutex);
1109
1107
}
1110
1108
 
1111
1109
 
1382
1380
}
1383
1381
 
1384
1382
 
1385
 
/*
1386
 
 *----------------------------------------------------------------------------
1387
 
 *
1388
 
 * HgfsRemoveFile --
1389
 
 *
1390
 
 *      Removes file from the hash table.
1391
 
 *
1392
 
 *      Note that unlike the other two hash functions, this one performs its own
1393
 
 *      locking since the removal doesn't need to be atomic with other
1394
 
 *      operations.  (This could change in the future if the functions that use
1395
 
 *      this one are reorganized.)
1396
 
 *
1397
 
 * Results:
1398
 
 *      Returns 0 on success and a non-zero error code on failure.
1399
 
 *
1400
 
 * Side effects:
1401
 
 *      None.
1402
 
 *
1403
 
 *----------------------------------------------------------------------------
1404
 
 */
1405
 
 
1406
 
static void
1407
 
HgfsRemoveFile(HgfsFile *fp,            // IN: File to remove
1408
 
               HgfsFileHashTable *htp)  // IN: Hash table to remove from
1409
 
{
1410
 
   ASSERT(fp);
1411
 
   ASSERT(htp);
1412
 
 
1413
 
   os_mutex_lock(htp->mutex);
1414
 
 
1415
 
   /* Take this file off its list */
1416
 
   DblLnkLst_Unlink1(&fp->listNode);
1417
 
 
1418
 
   os_mutex_unlock(htp->mutex);
1419
 
}
1420
 
 
1421
 
 
1422
1383
/* Other utility functions */
1423
1384
 
1424
1385