Changeset 66736 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- May 2, 2017 12:01:39 AM (8 years ago)
- Location:
- trunk/src/VBox/Runtime/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/fatvfs.cpp
r66733 r66736 3569 3569 3570 3570 /* Root also retains the whole file system. */ 3571 if ( !pDir->Core.pParentDir)3571 if (pDir->Core.pVol->pRootDir == pDir) 3572 3572 { 3573 3573 Assert(pDir->Core.pVol); … … 3602 3602 if (RTListIsEmpty(&pDir->OpenChildren)) 3603 3603 { 3604 bool const fIsRootDir = pDir->Core.pVol->pRootDir == pDir; 3605 3604 3606 uint32_t cRefs = RTVfsDirRelease(pDir->hVfsSelf); 3605 3607 Assert(cRefs != UINT32_MAX); NOREF(cRefs); … … 3608 3610 holds a reference to the root directory, it will remain valid after 3609 3611 the above release. */ 3610 if ( !pDir->Core.pParentDir)3612 if (fIsRootDir) 3611 3613 { 3612 3614 Assert(cRefs > 0); 3613 3615 Assert(pDir->Core.pVol); 3614 3616 Assert(pDir->Core.pVol == pChild->pVol); 3615 cRefs = RTVfsRe tain(pDir->Core.pVol->hVfsSelf);3617 cRefs = RTVfsRelease(pDir->Core.pVol->hVfsSelf); 3616 3618 Assert(cRefs != UINT32_MAX); NOREF(cRefs); 3617 3619 } -
trunk/src/VBox/Runtime/common/fs/iso9660vfs.cpp
r66735 r66736 291 291 { 292 292 PRTFSISO9660FILE pThis = (PRTFSISO9660FILE)pvThis; 293 LogFlow(("rtFsIso9660File_Close(%p)\n", pThis)); 293 294 return rtFsIso9660Obj_Close(&pThis->Core); 294 295 } … … 777 778 { 778 779 PRTFSISO9660DIR pThis = (PRTFSISO9660DIR)pvThis; 780 LogFlow(("rtFsIso9660Dir_Close(%p)\n", pThis)); 779 781 if (pThis->pbDir) 780 782 { … … 1035 1037 1036 1038 /* Root also retains the whole file system. */ 1037 if ( !pDir->Core.pParentDir)1039 if (pDir->Core.pVol->pRootDir == pDir) 1038 1040 { 1039 1041 Assert(pDir->Core.pVol); … … 1041 1043 cRefs = RTVfsRetain(pDir->Core.pVol->hVfsSelf); 1042 1044 Assert(cRefs != UINT32_MAX); NOREF(cRefs); 1045 LogFlow(("rtFsIso9660Dir_AddOpenChild(%p,%p) retains volume (%d)\n", pDir, pChild, cRefs)); 1043 1046 } 1044 } 1047 else 1048 LogFlow(("rtFsIso9660Dir_AddOpenChild(%p,%p) retains parent only (%d)\n", pDir, pChild, cRefs)); 1049 } 1050 else 1051 LogFlow(("rtFsIso9660Dir_AddOpenChild(%p,%p) retains nothing\n", pDir, pChild)); 1045 1052 RTListAppend(&pDir->OpenChildren, &pChild->Entry); 1046 1053 pChild->pParentDir = pDir; … … 1068 1075 if (RTListIsEmpty(&pDir->OpenChildren)) 1069 1076 { 1077 bool const fIsRootDir = pDir->Core.pVol->pRootDir == pDir; 1078 1070 1079 uint32_t cRefs = RTVfsDirRelease(pDir->hVfsSelf); 1071 1080 Assert(cRefs != UINT32_MAX); NOREF(cRefs); … … 1074 1083 holds a reference to the root directory, it will remain valid after 1075 1084 the above release. */ 1076 if ( !pDir->Core.pParentDir)1085 if (fIsRootDir) 1077 1086 { 1078 1087 Assert(cRefs > 0); 1079 1088 Assert(pDir->Core.pVol); 1080 1089 Assert(pDir->Core.pVol == pChild->pVol); 1081 cRefs = RTVfsRe tain(pDir->Core.pVol->hVfsSelf);1090 cRefs = RTVfsRelease(pDir->Core.pVol->hVfsSelf); 1082 1091 Assert(cRefs != UINT32_MAX); NOREF(cRefs); 1092 LogFlow(("rtFsIso9660Dir_RemoveOpenChild(%p,%p) releases volume (%d)\n", pDir, pChild, cRefs)); 1083 1093 } 1084 } 1094 else 1095 LogFlow(("rtFsIso9660Dir_RemoveOpenChild(%p,%p) releases parent only (%d)\n", pDir, pChild, cRefs)); 1096 } 1097 else 1098 LogFlow(("rtFsIso9660Dir_RemoveOpenChild(%p,%p) releases nothing\n", pDir, pChild)); 1085 1099 } 1086 1100 … … 1227 1241 { 1228 1242 PRTFSISO9660VOL pThis = (PRTFSISO9660VOL)pvThis; 1243 LogFlow(("rtFsIso9660Vol_Close(%p)\n", pThis)); 1229 1244 1230 1245 if (pThis->hVfsRootDir != NIL_RTVFSDIR) … … 1264 1279 { 1265 1280 *phVfsDir = pThis->hVfsRootDir; 1281 LogFlow(("rtFsIso9660Vol_OpenRoot -> %p\n", *phVfsDir)); 1266 1282 return VINF_SUCCESS; 1267 1283 } … … 1617 1633 * @param hVfsSelf The FAT VFS handle (no reference consumed). 1618 1634 * @param hVfsBacking The file backing the alleged FAT file system. 1619 * Reference is consumed (via rtFsIso9660Vol_ Destroy).1635 * Reference is consumed (via rtFsIso9660Vol_Close). 1620 1636 * @param fFlags Flags, MBZ. 1621 1637 * @param pErrInfo Where to return additional error info. Can be NULL. -
trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
r66652 r66736 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #define LOG_GROUP RTLOGGROUP_FS 31 32 #include <iprt/vfs.h> 32 33 #include <iprt/vfslowlevel.h> … … 35 36 #include <iprt/err.h> 36 37 #include <iprt/file.h> 38 #include <iprt/log.h> 37 39 #include <iprt/mem.h> 38 40 #include <iprt/param.h> … … 1905 1907 AssertPtrReturn(pThis, UINT32_MAX); 1906 1908 AssertReturn(pThis->uMagic == RTVFSDIR_MAGIC, UINT32_MAX); 1907 return rtVfsObjRetain(&pThis->Base); 1909 uint32_t cRefs = rtVfsObjRetain(&pThis->Base); 1910 LogFlow(("RTVfsDirRetain(%p/%p) -> %#x\n", pThis, pThis->Base.pvThis)); 1911 return cRefs; 1908 1912 } 1909 1913 … … 1916 1920 AssertPtrReturn(pThis, UINT32_MAX); 1917 1921 AssertReturn(pThis->uMagic == RTVFSDIR_MAGIC, UINT32_MAX); 1918 return rtVfsObjRelease(&pThis->Base); 1922 #ifdef LOG_ENABLED 1923 void *pvThis = pThis->Base.pvThis; 1924 #endif 1925 uint32_t cRefs = rtVfsObjRelease(&pThis->Base); 1926 LogFlow(("RTVfsDirRelease(%p/%p) -> %#x\n", pThis, pvThis)); 1927 return cRefs; 1919 1928 } 1920 1929
Note:
See TracChangeset
for help on using the changeset viewer.