Change prototype of ntfs_cluster_alloc like in kernel driver.
(Logical change 1.628)edge.strict_endians
parent
77802ca092
commit
1c283737c5
|
@ -35,8 +35,8 @@ typedef enum {
|
|||
LAST_ZONE = 1, /* For sanity checking. */
|
||||
} NTFS_CLUSTER_ALLOCATION_ZONES;
|
||||
|
||||
extern runlist *ntfs_cluster_alloc(ntfs_volume *vol, s64 count, LCN start_lcn,
|
||||
const NTFS_CLUSTER_ALLOCATION_ZONES zone, VCN start_vcn);
|
||||
extern runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
|
||||
LCN start_lcn, const NTFS_CLUSTER_ALLOCATION_ZONES zone);
|
||||
|
||||
extern int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl);
|
||||
|
||||
|
|
|
@ -1133,9 +1133,10 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, void *b)
|
|||
}
|
||||
}
|
||||
/* Allocate clusters to instantiate the hole. */
|
||||
rlc = ntfs_cluster_alloc(vol, ((ofs + to_write - 1) >>
|
||||
vol->cluster_size_bits) + 1,
|
||||
lcn_seek_from, DATA_ZONE, rl->vcn);
|
||||
rlc = ntfs_cluster_alloc(vol, rl->vcn,
|
||||
((ofs + to_write - 1) >>
|
||||
vol->cluster_size_bits) + 1,
|
||||
lcn_seek_from, DATA_ZONE);
|
||||
if (!rlc) {
|
||||
eo = errno;
|
||||
Dprintf("%s(): Failed to allocate clusters for "
|
||||
|
@ -3146,8 +3147,8 @@ static int ntfs_attr_make_non_resident(ntfs_attr *na,
|
|||
|
||||
if (new_allocated_size > 0) {
|
||||
/* Start by allocating clusters to hold the attribute value. */
|
||||
rl = ntfs_cluster_alloc(vol, new_allocated_size >>
|
||||
vol->cluster_size_bits, -1, DATA_ZONE, 0);
|
||||
rl = ntfs_cluster_alloc(vol, 0, new_allocated_size >>
|
||||
vol->cluster_size_bits, -1, DATA_ZONE);
|
||||
if (!rl) {
|
||||
if (errno != ENOSPC) {
|
||||
int eo = errno;
|
||||
|
@ -4248,11 +4249,11 @@ static int ntfs_non_resident_attr_expand(ntfs_attr *na, const s64 newsize)
|
|||
lcn_seek_from = rl->lcn + rl->length;
|
||||
}
|
||||
|
||||
rl = ntfs_cluster_alloc(vol, first_free_vcn -
|
||||
rl = ntfs_cluster_alloc(vol, na->allocated_size >>
|
||||
vol->cluster_size_bits, first_free_vcn -
|
||||
(na->allocated_size >>
|
||||
vol->cluster_size_bits), lcn_seek_from,
|
||||
DATA_ZONE, na->allocated_size >>
|
||||
vol->cluster_size_bits);
|
||||
DATA_ZONE);
|
||||
if (!rl) {
|
||||
err = errno;
|
||||
Dprintf("%s(): Eeek! Cluster allocation "
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
/**
|
||||
* ntfs_cluster_alloc - allocate clusters on an ntfs volume
|
||||
* @vol: mounted ntfs volume on which to allocate the clusters
|
||||
* @start_vcn: vcn to use for the first allocated cluster
|
||||
* @count: number of clusters to allocate
|
||||
* @start_lcn: starting lcn at which to allocate the clusters (or -1 if none)
|
||||
* @zone: zone from which to allocate the clusters
|
||||
* @start_vcn:
|
||||
*
|
||||
* Allocate @count clusters preferably starting at cluster @start_lcn or at the
|
||||
* current allocator position if @start_lcn is -1, on the mounted ntfs volume
|
||||
|
@ -90,8 +90,8 @@
|
|||
* possible code paths. So at least for now, I am leaving the double logic -
|
||||
* better safe than sorry... (AIA)
|
||||
*/
|
||||
runlist *ntfs_cluster_alloc(ntfs_volume *vol, s64 count, LCN start_lcn,
|
||||
const NTFS_CLUSTER_ALLOCATION_ZONES zone, VCN start_vcn)
|
||||
runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
|
||||
LCN start_lcn, const NTFS_CLUSTER_ALLOCATION_ZONES zone)
|
||||
{
|
||||
LCN zone_start, zone_end, bmp_pos, bmp_initial_pos, last_read_pos, lcn;
|
||||
LCN prev_lcn = 0, prev_run_len = 0, mft_zone_size;
|
||||
|
|
|
@ -595,7 +595,7 @@ static int ntfs_mft_bitmap_extend_allocation(ntfs_volume *vol)
|
|||
ntfs_debug("Appending one cluster to mft bitmap.");
|
||||
} else {
|
||||
/* Allocate a cluster from the DATA_ZONE. */
|
||||
rl2 = ntfs_cluster_alloc(vol, 1, lcn, DATA_ZONE, rl[1].vcn);
|
||||
rl2 = ntfs_cluster_alloc(vol, rl[1].vcn, 1, lcn, DATA_ZONE);
|
||||
if (!rl2) {
|
||||
ntfs_error(vol->sb, "Failed to allocate a cluster for "
|
||||
"the mft bitmap.");
|
||||
|
@ -907,7 +907,7 @@ static int ntfs_mft_data_extend_allocation(ntfs_volume *vol)
|
|||
"%lli.", (long long)nr);
|
||||
old_last_vcn = rl[1].vcn;
|
||||
do {
|
||||
rl2 = ntfs_cluster_alloc(vol, nr, lcn, MFT_ZONE, old_last_vcn);
|
||||
rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE);
|
||||
if (rl2)
|
||||
break;
|
||||
if (errno != ENOSPC || nr == min_nr) {
|
||||
|
|
Loading…
Reference in New Issue