mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-28 19:06:42 -05:00
Detects the case of physical offsets not reported beucase the file doesn't have one.
This commit is contained in:
parent
cffbba8aee
commit
6deecb26de
6 changed files with 36 additions and 10 deletions
9
mingw.c
9
mingw.c
|
|
@ -1130,7 +1130,10 @@ int filephy(const char* file, struct stat* st, uint64_t* physical)
|
|||
} else if (error == ERROR_HANDLE_EOF) {
|
||||
/* if the file is small, it can be stored in the Master File Table (MFT) */
|
||||
/* and then it doesn't have a physical address */
|
||||
rpb->ExtentCount = 0;
|
||||
/* In such case we report a specific fake address, to report this special condition */
|
||||
/* that it's different from the 0 offset reported by the underline file system */
|
||||
rpb->ExtentCount = 1;
|
||||
rpb->Extents[0].Lcn.QuadPart = FILEPHY_WITHOUT_OFFSET;
|
||||
} else {
|
||||
windows_errno(error);
|
||||
CloseHandle(h);
|
||||
|
|
@ -1141,9 +1144,9 @@ int filephy(const char* file, struct stat* st, uint64_t* physical)
|
|||
CloseHandle(h);
|
||||
|
||||
if (rpb->ExtentCount < 1)
|
||||
*physical = 0;
|
||||
*physical = FILEPHY_UNREPORTED_OFFSET;
|
||||
else
|
||||
*physical = rpb->Extents[0].Lcn.QuadPart;
|
||||
*physical = rpb->Extents[0].Lcn.QuadPart + FILEPHY_REAL_OFFSET;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue