fix free space calculation for >1 TB volumes
parent
6be9b754b6
commit
b032c0e68b
|
@ -340,7 +340,7 @@ extern int ntfs_attr_exist(ntfs_inode *ni, const ATTR_TYPES type,
|
|||
ntfschar *name, u32 name_len);
|
||||
extern int ntfs_attr_remove(ntfs_inode *ni, const ATTR_TYPES type,
|
||||
ntfschar *name, u32 name_len);
|
||||
extern long ntfs_attr_get_free_bits(ntfs_attr *na);
|
||||
extern s64 ntfs_attr_get_free_bits(ntfs_attr *na);
|
||||
|
||||
#endif /* defined _NTFS_ATTRIB_H */
|
||||
|
||||
|
|
|
@ -5042,15 +5042,15 @@ int ntfs_attr_remove(ntfs_inode *ni, const ATTR_TYPES type, ntfschar *name,
|
|||
return ret;
|
||||
}
|
||||
|
||||
long ntfs_attr_get_free_bits(ntfs_attr *na)
|
||||
s64 ntfs_attr_get_free_bits(ntfs_attr *na)
|
||||
{
|
||||
u8 *buf;
|
||||
long nr_free = 0;
|
||||
s64 nr_free = 0;
|
||||
s64 br, total = 0;
|
||||
|
||||
buf = ntfs_malloc(na->ni->vol->cluster_size);
|
||||
if (!buf)
|
||||
return -errno;
|
||||
return -1;
|
||||
while (1) {
|
||||
int i, j;
|
||||
|
||||
|
@ -5065,7 +5065,7 @@ long ntfs_attr_get_free_bits(ntfs_attr *na)
|
|||
}
|
||||
free(buf);
|
||||
if (!total || br < 0)
|
||||
return -errno;
|
||||
return -1;
|
||||
return nr_free;
|
||||
}
|
||||
|
||||
|
|
|
@ -167,10 +167,10 @@ static int ntfs_fuse_is_named_data_stream(const char *path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static long ntfs_get_nr_free_mft_records(ntfs_volume *vol)
|
||||
static s64 ntfs_get_nr_free_mft_records(ntfs_volume *vol)
|
||||
{
|
||||
ntfs_attr *na = vol->mftbmp_na;
|
||||
long nr_free = ntfs_attr_get_free_bits(na);
|
||||
s64 nr_free = ntfs_attr_get_free_bits(na);
|
||||
|
||||
if (nr_free >= 0)
|
||||
nr_free += (na->allocated_size - na->data_size) << 3;
|
||||
|
|
Loading…
Reference in New Issue