Changeset 41549 in vbox for trunk/src/VBox/Runtime/include
- Timestamp:
- Jun 1, 2012 5:29:05 PM (13 years ago)
- Location:
- trunk/src/VBox/Runtime/include/internal
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/dvm.h
r40137 r41549 122 122 123 123 /** 124 * Returns whether the given range is in use by the volume manager. 125 * 126 * @returns IPRT status code. 127 * @param hVolMgrFmt The format specific volume manager handle. 128 * @param offStart Start offset of the range. 129 * @param cbRange Size of the range to check in bytes. 130 * @param pfUsed Where to store whether the range is in use by the 131 * volume manager. 132 */ 133 DECLCALLBACKMEMBER(int, pfnQueryRangeUse)(RTDVMFMT hVolMgrFmt, 134 uint64_t off, uint64_t cbRange, 135 bool *pfUsed); 136 137 /** 124 138 * Gets the number of valid volumes in the map. 125 139 * -
trunk/src/VBox/Runtime/include/internal/filesystem.h
r40029 r41549 31 31 #include <iprt/err.h> 32 32 #include <iprt/assert.h> 33 #include <iprt/vfslowlevel.h> 33 34 #include "internal/magics.h" 34 35 35 36 RT_C_DECLS_BEGIN 36 37 37 /** A filesystem format handle. */ 38 typedef struct RTFILESYSTEMFMTINT *RTFILESYSTEMFMT; 39 /** Pointer to a filesystem format handle. */ 40 typedef RTFILESYSTEMFMT *PRTFILESYSTEMFMT; 41 /** NIL filesystem format handle. */ 42 #define NIL_RTFILESYSTEMFMT ((RTFILESYSTEMFMT)~0) 38 /******************************************************************************* 39 * Structures and Typedefs * 40 *******************************************************************************/ 43 41 44 /** A medium handle. */45 typedef struct RTFILESYSTEMMEDIUMINT *RTFILESYSTEMMEDIUM;46 /** Pointer to a medium handle. */47 typedef RTFILESYSTEMMEDIUM *PRTFILESYSTEMMEDIUM;42 /** Filesystem format specific initialization structure. */ 43 typedef DECLCALLBACK(int) FNRTFILESYSTEMINIT(void *pvThis, RTVFSFILE hVfsFile); 44 /** Pointer to a format specific initialization structure. */ 45 typedef FNRTFILESYSTEMINIT *PFNRTFILESYSTEMINIT; 48 46 49 /** Score to indicate that the backend can't handle the format at all */50 47 #define RTFILESYSTEM_MATCH_SCORE_UNSUPPORTED 0 51 /** Score to indicate that a backend supports the format 52 * but there can be other backends. */ 53 #define RTFILESYSTEM_MATCH_SCORE_SUPPORTED (UINT32_MAX/2) 54 /** Score to indicate a perfect match. */ 55 #define RTFILESYSTEM_MATCH_SCORE_PERFECT UINT32_MAX 48 #define RTFILESYSTEM_MATCH_SCORE_SUPPORTED UINT32_MAX 56 49 57 50 /** 58 * Filesystem format operations.51 * Filesystem descriptor. 59 52 */ 60 typedef struct RTFILESYSTEM FMTOPS53 typedef struct RTFILESYSTEMDESC 61 54 { 62 /** Name of the format. */ 63 const char *pcszFmt; 55 /** Size of the filesystem specific state in bytes. */ 56 size_t cbFs; 57 /** Pointer to the VFS vtable. */ 58 RTVFSOPS VfsOps; 64 59 65 60 /** 66 * Probes the given disk for known structures.61 * Probes the underlying for a known filesystem. 67 62 * 68 63 * @returns IPRT status code. 69 * @param h Medium Medium handle.70 * @param puScore 64 * @param hVfsFile VFS file handle of the underlying medium. 65 * @param puScore Where to store the match score on success. 71 66 */ 72 DECLCALLBACKMEMBER(int, pfnProbe) (RTFILESYSTEMMEDIUM hMedium, uint32_t *puScore);67 DECLCALLBACKMEMBER(int, pfnProbe) (RTVFSFILE hVfsFile, uint32_t *puScore); 73 68 74 69 /** 75 * Opens the format to set up all structures.70 * Initializes the given filesystem state. 76 71 * 77 72 * @returns IPRT status code. 78 * @param hMedium Medium handle.79 * @param phFileSysFmt Where to store the filesystem format instance on success.73 * @param pvThis Uninitialized filesystem state. 74 * @param hVfsFile VFS file handle of the underlying medium. 80 75 */ 81 DECLCALLBACKMEMBER(int, pfn Open)(RTFILESYSTEMMEDIUM hMedium, PRTFILESYSTEMFMT phFsFmt);76 DECLCALLBACKMEMBER(int, pfnInit) (void *pvThis, RTVFSFILE hVfsFile); 82 77 83 /** 84 * Closes the filesystem format. 85 * 86 * @returns IPRT status code. 87 * @param hFsFmt The format specific filesystem handle. 88 */ 89 DECLCALLBACKMEMBER(int, pfnClose)(RTFILESYSTEMFMT hFsFmt); 78 } RTFILESYSTEMDESC; 79 /** Pointer to a filesystem descriptor. */ 80 typedef RTFILESYSTEMDESC *PRTFILESYSTEMDESC; 81 typedef const RTFILESYSTEMDESC *PCRTFILESYSTEMDESC; 90 82 91 /** 92 * Returns block size of the given filesystem. 93 * 94 * @returns Block size of filesystem. 95 * @param hFsFmt The format specific filesystem handle. 96 */ 97 DECLCALLBACKMEMBER(uint64_t, pfnGetBlockSize)(RTFILESYSTEMFMT hFsFmt); 98 99 /** 100 * Query the use of the given range in the filesystem. 101 * 102 * @returns IPRT status code. 103 * @param hFsFmt The format specific filesystem handle. 104 * @param offStart Start offset to check. 105 * @param cb Size of the range to check. 106 * @param pfUsed Where to store whether the range is in use 107 * by the filesystem. 108 */ 109 DECLCALLBACKMEMBER(int, pfnQueryRangeUse)(RTFILESYSTEMFMT hFsFmt, uint64_t offStart, 110 size_t cb, bool *pfUsed); 111 112 } RTFILESYSTEMFMTOPS; 113 /** Pointer to a filesystem format ops table. */ 114 typedef RTFILESYSTEMFMTOPS *PRTFILESYSTEMFMTOPS; 115 /** Pointer to a const filesystem format ops table. */ 116 typedef const RTFILESYSTEMFMTOPS *PCRTFILESYSTEMFMTOPS; 117 118 /** Converts a LBA number to the byte offset. */ 119 #define RTFILESYSTEM_LBA2BYTE(lba, disk) ((lba) * (disk)->cbSector) 120 /** Converts a Byte offset to the LBA number. */ 121 #define RTFILESYSTEM_BYTE2LBA(off, disk) ((off) / (disk)->cbSector) 122 123 /** 124 * Return size of the medium in bytes. 125 * 126 * @returns Size of the medium in bytes. 127 * @param hMedium The medium handle. 128 */ 129 DECLHIDDEN(uint64_t) rtFilesystemMediumGetSize(RTFILESYSTEMMEDIUM hMedium); 130 131 /** 132 * Read from the medium at the given offset. 133 * 134 * @returns IPRT status code. 135 * @param hMedium The medium handle to read from. 136 * @param off Start offset. 137 * @param pvBuf Destination buffer. 138 * @param cbRead How much to read. 139 */ 140 DECLHIDDEN(int) rtFilesystemMediumRead(RTFILESYSTEMMEDIUM hMedium, uint64_t off, 141 void *pvBuf, size_t cbRead); 142 143 /** 144 * Write to the disk at the given offset. 145 * 146 * @returns IPRT status code. 147 * @param hMedium The medium handle to write to. 148 * @param off Start offset. 149 * @param pvBuf Source buffer. 150 * @param cbWrite How much to write. 151 */ 152 DECLHIDDEN(int) rtFilesystemMediumWrite(RTFILESYSTEMMEDIUM hMedium, uint64_t off, 153 const void *pvBuf, size_t cbWrite); 83 extern DECLHIDDEN(RTFILESYSTEMDESC const) g_rtFsExt; 154 84 155 85 RT_C_DECLS_END -
trunk/src/VBox/Runtime/include/internal/magics.h
r40855 r41549 59 59 /** The value of RTFILEAIOREQINT::u32Magic. (Stephen Edwin King) */ 60 60 #define RTFILEAIOREQ_MAGIC UINT32_C(0x19470921) 61 /** The value of RTFILESYSTEMINT::u32Magic. (John Scalzi) */62 #define RTFILESYSTEM_MAGIC UINT32_C(0x19690510)63 /** The value of RTFILESYSTEMINT::u32Magic after close. */64 #define RTFILESYSTEM_MAGIC_DEAD (~RTFILESYSTEM_MAGIC)65 61 /** The value of RTENVINTERNAL::u32Magic. (Rumiko Takahashi) */ 66 62 #define RTENV_MAGIC UINT32_C(0x19571010)
Note:
See TracChangeset
for help on using the changeset viewer.