Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 872995 Details for
Bug 907082
sys-fs/mdadm-4.2-r1 - restripe.c: error: off64_t undeclared (first use in this function)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
lfs64.patch (from Alpine Linux)
lfs64.patch (text/plain), 21.75 KB, created by
ernsteiswuerfel
on 2023-10-16 17:39:57 UTC
(
hide
)
Description:
lfs64.patch (from Alpine Linux)
Filename:
MIME Type:
Creator:
ernsteiswuerfel
Created:
2023-10-16 17:39:57 UTC
Size:
21.75 KB
patch
obsolete
>needed since https://github.com/bminor/musl/commit/25e6fee27f4a293728dd15b659170e7b9c7db9bc >-- >diff --git a/Grow.c b/Grow.c >index 9c6fc95..bb21333 100644 >--- a/Grow.c >+++ b/Grow.c >@@ -4260,10 +4260,10 @@ static int grow_backup(struct mdinfo *sra, > bsb.magic[15] = '2'; > for (i = 0; i < dests; i++) > if (part) >- lseek64(destfd[i], destoffsets[i] + >+ lseek(destfd[i], destoffsets[i] + > __le64_to_cpu(bsb.devstart2)*512, 0); > else >- lseek64(destfd[i], destoffsets[i], 0); >+ lseek(destfd[i], destoffsets[i], 0); > > rv = save_stripes(sources, offsets, disks, chunk, level, layout, > dests, destfd, offset * 512 * odata, >@@ -4282,14 +4282,14 @@ static int grow_backup(struct mdinfo *sra, > ((char*)&bsb.sb_csum2)-((char*)&bsb)); > > rv = -1; >- if ((unsigned long long)lseek64(destfd[i], >+ if ((unsigned long long)lseek(destfd[i], > destoffsets[i] - 4096, 0) != > destoffsets[i] - 4096) > break; > if (write(destfd[i], &bsb, 512) != 512) > break; > if (destoffsets[i] > 4096) { >- if ((unsigned long long)lseek64(destfd[i], destoffsets[i]+stripes*chunk*odata, 0) != >+ if ((unsigned long long)lseek(destfd[i], destoffsets[i]+stripes*chunk*odata, 0) != > destoffsets[i]+stripes*chunk*odata) > break; > if (write(destfd[i], &bsb, 512) != 512) >@@ -4339,7 +4339,7 @@ static int forget_backup(int dests, int *destfd, > if (memcmp(bsb.magic, "md_backup_data-2", 16) == 0) > bsb.sb_csum2 = bsb_csum((char*)&bsb, > ((char*)&bsb.sb_csum2)-((char*)&bsb)); >- if ((unsigned long long)lseek64(destfd[i], destoffsets[i]-4096, 0) != >+ if ((unsigned long long)lseek(destfd[i], destoffsets[i]-4096, 0) != > destoffsets[i]-4096) > rv = -1; > if (rv == 0 && write(destfd[i], &bsb, 512) != 512) >@@ -4367,7 +4367,7 @@ static void validate(int afd, int bfd, unsigned long long offset) > */ > if (afd < 0) > return; >- lseek64(bfd, offset - 4096, 0); >+ lseek(bfd, offset - 4096, 0); > if (read(bfd, &bsb2, 512) != 512) > fail("cannot read bsb"); > if (bsb2.sb_csum != bsb_csum((char*)&bsb2, >@@ -4398,12 +4398,12 @@ static void validate(int afd, int bfd, unsigned long long offset) > } > } > >- lseek64(bfd, offset, 0); >+ lseek(bfd, offset, 0); > if ((unsigned long long)read(bfd, bbuf, len) != len) { > //printf("len %llu\n", len); > fail("read first backup failed"); > } >- lseek64(afd, __le64_to_cpu(bsb2.arraystart)*512, 0); >+ lseek(afd, __le64_to_cpu(bsb2.arraystart)*512, 0); > if ((unsigned long long)read(afd, abuf, len) != len) > fail("read first from array failed"); > if (memcmp(bbuf, abuf, len) != 0) { >@@ -4431,10 +4431,10 @@ static void validate(int afd, int bfd, unsigned long long offset) > bbuf = xmalloc(abuflen); > } > >- lseek64(bfd, offset+__le64_to_cpu(bsb2.devstart2)*512, 0); >+ lseek(bfd, offset+__le64_to_cpu(bsb2.devstart2)*512, 0); > if ((unsigned long long)read(bfd, bbuf, len) != len) > fail("read second backup failed"); >- lseek64(afd, __le64_to_cpu(bsb2.arraystart2)*512, 0); >+ lseek(afd, __le64_to_cpu(bsb2.arraystart2)*512, 0); > if ((unsigned long long)read(afd, abuf, len) != len) > fail("read second from array failed"); > if (memcmp(bbuf, abuf, len) != 0) >@@ -4711,7 +4711,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, > st->ss->getinfo_super(st, &dinfo, NULL); > st->ss->free_super(st); > >- if (lseek64(fd, >+ if (lseek(fd, > (dinfo.data_offset + dinfo.component_size - 8) <<9, > 0) < 0) { > pr_err("Cannot seek on device %d\n", i); >@@ -4811,7 +4811,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, > goto nonew; /* No new data here */ > } > } >- if (lseek64(fd, __le64_to_cpu(bsb.devstart)*512, 0)< 0) { >+ if (lseek(fd, __le64_to_cpu(bsb.devstart)*512, 0)< 0) { > second_fail: > if (verbose) > pr_err("Failed to verify secondary backup-metadata block on %s\n", >@@ -4819,7 +4819,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, > continue; /* Cannot seek */ > } > /* There should be a duplicate backup superblock 4k before here */ >- if (lseek64(fd, -4096, 1) < 0 || >+ if (lseek(fd, -4096, 1) < 0 || > read(fd, &bsb2, sizeof(bsb2)) != sizeof(bsb2)) > goto second_fail; /* Cannot find leading superblock */ > if (bsb.magic[15] == '1') >diff --git a/raid6check.c b/raid6check.c >index a8e6005..392cf29 100644 >--- a/raid6check.c >+++ b/raid6check.c >@@ -206,7 +206,7 @@ int autorepair(int *disk, unsigned long long start, int chunk_size, > for(j = 0; j < (chunk_size >> CHECK_PAGE_BITS); j++) { > if(page_to_write[j] == 1) { > int slot = block_index_for_slot[disk[j]]; >- lseek64(source[slot], offsets[slot] + start * chunk_size + j * CHECK_PAGE_SIZE, SEEK_SET); >+ lseek(source[slot], offsets[slot] + start * chunk_size + j * CHECK_PAGE_SIZE, SEEK_SET); > write_res += write(source[slot], > blocks[disk[j]] + j * CHECK_PAGE_SIZE, > CHECK_PAGE_SIZE); >@@ -279,9 +279,9 @@ int manual_repair(int chunk_size, int syndrome_disks, > } > > int write_res1, write_res2; >- off64_t seek_res; >+ off_t seek_res; > >- seek_res = lseek64(source[fd1], >+ seek_res = lseek(source[fd1], > offsets[fd1] + start * chunk_size, SEEK_SET); > if (seek_res < 0) { > fprintf(stderr, "lseek failed for failed_disk1\n"); >@@ -289,7 +289,7 @@ int manual_repair(int chunk_size, int syndrome_disks, > } > write_res1 = write(source[fd1], blocks[failed_slot1], chunk_size); > >- seek_res = lseek64(source[fd2], >+ seek_res = lseek(source[fd2], > offsets[fd2] + start * chunk_size, SEEK_SET); > if (seek_res < 0) { > fprintf(stderr, "lseek failed for failed_disk2\n"); >@@ -374,7 +374,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, > goto exitCheck; > } > for (i = 0 ; i < raid_disks ; i++) { >- off64_t seek_res = lseek64(source[i], offsets[i] + start * chunk_size, >+ off_t seek_res = lseek(source[i], offsets[i] + start * chunk_size, > SEEK_SET); > if (seek_res < 0) { > fprintf(stderr, "lseek to source %d failed\n", i); >diff --git a/restripe.c b/restripe.c >index a7a7229..eec3619 100644 >--- a/restripe.c >+++ b/restripe.c >@@ -581,7 +581,7 @@ int save_stripes(int *source, unsigned long long *offsets, > raid_disks, level, layout); > if (dnum < 0) abort(); > if (source[dnum] < 0 || >- lseek64(source[dnum], >+ lseek(source[dnum], > offsets[dnum] + offset, 0) < 0 || > read(source[dnum], buf+disk * chunk_size, > chunk_size) != chunk_size) { >@@ -754,8 +754,8 @@ int restore_stripes(int *dest, unsigned long long *offsets, > raid_disks, level, layout); > if (src_buf == NULL) { > /* read from file */ >- if (lseek64(source, read_offset, 0) != >- (off64_t)read_offset) { >+ if (lseek(source, read_offset, 0) != >+ (off_t)read_offset) { > rv = -1; > goto abort; > } >@@ -816,7 +816,7 @@ int restore_stripes(int *dest, unsigned long long *offsets, > } > for (i=0; i < raid_disks ; i++) > if (dest[i] >= 0) { >- if (lseek64(dest[i], >+ if (lseek(dest[i], > offsets[i]+offset, 0) < 0) { > rv = -1; > goto abort; >@@ -866,7 +866,7 @@ int test_stripes(int *source, unsigned long long *offsets, > int disk; > > for (i = 0 ; i < raid_disks ; i++) { >- if ((lseek64(source[i], offsets[i]+start, 0) < 0) || >+ if ((lseek(source[i], offsets[i]+start, 0) < 0) || > (read(source[i], stripes[i], chunk_size) != > chunk_size)) { > free(q); >diff --git a/super-ddf.c b/super-ddf.c >index 3f304cd..7b10568 100644 >--- a/super-ddf.c >+++ b/super-ddf.c >@@ -816,7 +816,7 @@ static int load_ddf_header(int fd, unsigned long long lba, > if (lba >= size-1) > return 0; > >- if (lseek64(fd, lba<<9, 0) < 0) >+ if (lseek(fd, lba<<9, 0) < 0) > return 0; > > if (read(fd, hdr, 512) != 512) >@@ -870,7 +870,7 @@ static void *load_section(int fd, struct ddf_super *super, void *buf, > else > offset += be64_to_cpu(super->active->secondary_lba); > >- if ((unsigned long long)lseek64(fd, offset<<9, 0) != (offset<<9)) { >+ if ((unsigned long long)lseek(fd, offset<<9, 0) != (offset<<9)) { > if (dofree) > free(buf); > return NULL; >@@ -889,7 +889,7 @@ static int load_ddf_headers(int fd, struct ddf_super *super, char *devname) > > get_dev_size(fd, NULL, &dsize); > >- if (lseek64(fd, dsize-512, 0) < 0) { >+ if (lseek(fd, dsize-512, 0) < 0) { > if (devname) > pr_err("Cannot seek to anchor block on %s: %s\n", > devname, strerror(errno)); >@@ -1691,7 +1691,7 @@ static int copy_metadata_ddf(struct supertype *st, int from, int to) > if (!get_dev_size(from, NULL, &dsize)) > goto err; > >- if (lseek64(from, dsize-512, 0) < 0) >+ if (lseek(from, dsize-512, 0) < 0) > goto err; > if (read(from, buf, 512) != 512) > goto err; >@@ -1710,8 +1710,8 @@ static int copy_metadata_ddf(struct supertype *st, int from, int to) > > bytes = dsize - offset; > >- if (lseek64(from, offset, 0) < 0 || >- lseek64(to, offset, 0) < 0) >+ if (lseek(from, offset, 0) < 0 || >+ lseek(to, offset, 0) < 0) > goto err; > while (written < bytes) { > int n = bytes - written; >@@ -3037,7 +3037,7 @@ static int __write_ddf_structure(struct dl *d, struct ddf_super *ddf, __u8 type) > header->openflag = 1; > header->crc = calc_crc(header, 512); > >- lseek64(fd, sector<<9, 0); >+ lseek(fd, sector<<9, 0); > if (write(fd, header, 512) < 0) > goto out; > >@@ -3101,7 +3101,7 @@ out: > header->openflag = 0; > header->crc = calc_crc(header, 512); > >- lseek64(fd, sector<<9, 0); >+ lseek(fd, sector<<9, 0); > if (write(fd, header, 512) < 0) > ret = 0; > >@@ -3154,7 +3154,7 @@ static int _write_super_to_disk(struct ddf_super *ddf, struct dl *d) > if (!__write_ddf_structure(d, ddf, DDF_HEADER_SECONDARY)) > return 0; > >- lseek64(fd, (size-1)*512, SEEK_SET); >+ lseek(fd, (size-1)*512, SEEK_SET); > if (write(fd, &ddf->anchor, 512) < 0) > return 0; > >@@ -3909,7 +3909,7 @@ static int store_super_ddf(struct supertype *st, int fd) > return 1; > memset(buf, 0, 512); > >- lseek64(fd, dsize-512, 0); >+ lseek(fd, dsize-512, 0); > rc = write(fd, buf, 512); > free(buf); > if (rc < 0) >diff --git a/super-intel.c b/super-intel.c >index d5fad10..236e2ee 100644 >--- a/super-intel.c >+++ b/super-intel.c >@@ -3092,7 +3092,7 @@ static int read_imsm_migr_rec(int fd, struct intel_super *super) > unsigned long long dsize; > > get_dev_size(fd, NULL, &dsize); >- if (lseek64(fd, dsize - (sector_size*MIGR_REC_SECTOR_POSITION), >+ if (lseek(fd, dsize - (sector_size*MIGR_REC_SECTOR_POSITION), > SEEK_SET) < 0) { > pr_err("Cannot seek to anchor block: %s\n", > strerror(errno)); >@@ -3283,7 +3283,7 @@ static int write_imsm_migr_rec(struct supertype *st) > continue; > > get_dev_size(sd->fd, NULL, &dsize); >- if (lseek64(sd->fd, dsize - (MIGR_REC_SECTOR_POSITION * >+ if (lseek(sd->fd, dsize - (MIGR_REC_SECTOR_POSITION * > sector_size), > SEEK_SET) < 0) { > pr_err("Cannot seek to anchor block: %s\n", >@@ -4404,7 +4404,7 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname) > return 1; > } > >- if (lseek64(fd, dsize - (sector_size * 2), SEEK_SET) < 0) { >+ if (lseek(fd, dsize - (sector_size * 2), SEEK_SET) < 0) { > if (devname) > pr_err("Cannot seek to anchor block on %s: %s\n", > devname, strerror(errno)); >@@ -4472,7 +4472,7 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname) > } > > /* read the extended mpb */ >- if (lseek64(fd, dsize - (sector_size * (2 + sectors)), SEEK_SET) < 0) { >+ if (lseek(fd, dsize - (sector_size * (2 + sectors)), SEEK_SET) < 0) { > if (devname) > pr_err("Cannot seek to extended mpb on %s: %s\n", > devname, strerror(errno)); >@@ -5994,7 +5994,7 @@ static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk, > > /* clear migr_rec when adding disk to container */ > memset(super->migr_rec_buf, 0, MIGR_REC_BUF_SECTORS*MAX_SECTOR_SIZE); >- if (lseek64(fd, size - MIGR_REC_SECTOR_POSITION*member_sector_size, >+ if (lseek(fd, size - MIGR_REC_SECTOR_POSITION*member_sector_size, > SEEK_SET) >= 0) { > if ((unsigned int)write(fd, super->migr_rec_buf, > MIGR_REC_BUF_SECTORS*member_sector_size) != >@@ -6219,7 +6219,7 @@ static int write_super_imsm(struct supertype *st, int doclose) > unsigned long long dsize; > > get_dev_size(d->fd, NULL, &dsize); >- if (lseek64(d->fd, dsize - sector_size, >+ if (lseek(d->fd, dsize - sector_size, > SEEK_SET) >= 0) { > if ((unsigned int)write(d->fd, > super->migr_rec_buf, >@@ -6302,7 +6302,7 @@ static int write_ppl_header(unsigned long long ppl_sector, int fd, void *buf) > > ppl_hdr->checksum = __cpu_to_le32(~crc32c_le(~0, buf, PPL_HEADER_SIZE)); > >- if (lseek64(fd, ppl_sector * 512, SEEK_SET) < 0) { >+ if (lseek(fd, ppl_sector * 512, SEEK_SET) < 0) { > ret = -errno; > perror("Failed to seek to PPL header location"); > return ret; >@@ -6396,7 +6396,7 @@ static int validate_ppl_imsm(struct supertype *st, struct mdinfo *info, > > dprintf("Checking potential PPL at offset: %llu\n", ppl_offset); > >- if (lseek64(d->fd, info->ppl_sector * 512 + ppl_offset, >+ if (lseek(d->fd, info->ppl_sector * 512 + ppl_offset, > SEEK_SET) < 0) { > perror("Failed to seek to PPL header location"); > ret = -1; >@@ -8858,7 +8858,7 @@ static int store_imsm_mpb(int fd, struct imsm_super *mpb) > sectors = mpb_sectors(mpb, sector_size) - 1; > > /* write the extended mpb to the sectors preceeding the anchor */ >- if (lseek64(fd, dsize - (sector_size * (2 + sectors)), >+ if (lseek(fd, dsize - (sector_size * (2 + sectors)), > SEEK_SET) < 0) > return 1; > >@@ -8868,7 +8868,7 @@ static int store_imsm_mpb(int fd, struct imsm_super *mpb) > } > > /* first block is stored on second to last sector of the disk */ >- if (lseek64(fd, dsize - (sector_size * 2), SEEK_SET) < 0) >+ if (lseek(fd, dsize - (sector_size * 2), SEEK_SET) < 0) > return 1; > > if ((unsigned int)write(fd, buf, sector_size) != sector_size) >@@ -11058,7 +11058,7 @@ int recover_backup_imsm(struct supertype *st, struct mdinfo *info) > skipped_disks++; > continue; > } >- if (lseek64(dl_disk->fd, read_offset, SEEK_SET) < 0) { >+ if (lseek(dl_disk->fd, read_offset, SEEK_SET) < 0) { > pr_err("Cannot seek to block: %s\n", > strerror(errno)); > skipped_disks++; >@@ -11070,7 +11070,7 @@ int recover_backup_imsm(struct supertype *st, struct mdinfo *info) > skipped_disks++; > continue; > } >- if (lseek64(dl_disk->fd, write_offset, SEEK_SET) < 0) { >+ if (lseek(dl_disk->fd, write_offset, SEEK_SET) < 0) { > pr_err("Cannot seek to block: %s\n", > strerror(errno)); > skipped_disks++; >@@ -12320,7 +12320,7 @@ static int imsm_manage_reshape( > unsigned long long dsize; > > get_dev_size(d->fd, NULL, &dsize); >- if (lseek64(d->fd, dsize - MIGR_REC_SECTOR_POSITION*sector_size, >+ if (lseek(d->fd, dsize - MIGR_REC_SECTOR_POSITION*sector_size, > SEEK_SET) >= 0) { > if ((unsigned int)write(d->fd, super->migr_rec_buf, > MIGR_REC_BUF_SECTORS*sector_size) != >@@ -12476,7 +12476,7 @@ static int validate_internal_bitmap_for_drive(struct supertype *st, > } > } > >- if (lseek64(fd, offset * super->sector_size, SEEK_SET) < 0) >+ if (lseek(fd, offset * super->sector_size, SEEK_SET) < 0) > goto abort; > if (read(fd, read_buf, IMSM_BITMAP_HEADER_SIZE) != > IMSM_BITMAP_HEADER_SIZE) >@@ -12605,7 +12605,7 @@ static int locate_bitmap_imsm(struct supertype *st, int fd, int node_num) > offset = get_bitmap_header_sector(super, super->current_vol); > dprintf("bitmap header offset is %llu\n", offset); > >- lseek64(fd, offset << 9, 0); >+ lseek(fd, offset << 9, 0); > > return 0; > } >@@ -12659,7 +12659,7 @@ static int write_init_bitmap_imsm(struct supertype *st, int fd, > return -1; > memset(buf, 0xFF, MAX_SECTOR_SIZE); > offset = get_bitmap_sector(super, vol_idx); >- lseek64(fd, offset << 9, 0); >+ lseek(fd, offset << 9, 0); > while (written < IMSM_BITMAP_AREA_SIZE) { > to_write = IMSM_BITMAP_AREA_SIZE - written; > if (to_write > MAX_SECTOR_SIZE) >diff --git a/super0.c b/super0.c >index b79b97a..74bb418 100644 >--- a/super0.c >+++ b/super0.c >@@ -327,12 +327,12 @@ static int copy_metadata0(struct supertype *st, int from, int to) > > offset *= 512; > >- if (lseek64(from, offset, 0) < 0LL) >+ if (lseek(from, offset, 0) < 0LL) > goto err; > if (read(from, buf, bufsize) != bufsize) > goto err; > >- if (lseek64(to, offset, 0) < 0LL) >+ if (lseek(to, offset, 0) < 0LL) > goto err; > super = buf; > if (super->md_magic != MD_SB_MAGIC || >@@ -862,7 +862,7 @@ static int store_super0(struct supertype *st, int fd) > offset = dsize/512 - 8*2; > offset &= ~(4*2-1); > offset *= 512; >- if (lseek64(fd, offset, 0)< 0LL) >+ if (lseek(fd, offset, 0)< 0LL) > ret = 3; > else if (write(fd, st->other, 1024) != 1024) > ret = 4; >@@ -877,7 +877,7 @@ static int store_super0(struct supertype *st, int fd) > > offset *= 512; > >- if (lseek64(fd, offset, 0)< 0LL) >+ if (lseek(fd, offset, 0)< 0LL) > return 3; > > if (write(fd, super, sizeof(*super)) != sizeof(*super)) >@@ -1004,7 +1004,7 @@ static int load_super0(struct supertype *st, int fd, char *devname) > > offset *= 512; > >- if (lseek64(fd, offset, 0)< 0LL) { >+ if (lseek(fd, offset, 0)< 0LL) { > if (devname) > pr_err("Cannot seek to superblock on %s: %s\n", > devname, strerror(errno)); >@@ -1189,7 +1189,7 @@ static int locate_bitmap0(struct supertype *st, int fd, int node_num) > > offset += MD_SB_BYTES; > >- lseek64(fd, offset, 0); >+ lseek(fd, offset, 0); > return 0; > } > >@@ -1214,7 +1214,7 @@ static int write_bitmap0(struct supertype *st, int fd, enum bitmap_update update > > offset *= 512; > >- if (lseek64(fd, offset + 4096, 0)< 0LL) >+ if (lseek(fd, offset + 4096, 0)< 0LL) > return 3; > > if (posix_memalign(&buf, 4096, 4096)) >diff --git a/super1.c b/super1.c >index a12a5bc..4e098b0 100644 >--- a/super1.c >+++ b/super1.c >@@ -761,7 +761,7 @@ static int copy_metadata1(struct supertype *st, int from, int to) > goto err; > } > >- if (lseek64(from, sb_offset << 9, 0) < 0LL) >+ if (lseek(from, sb_offset << 9, 0) < 0LL) > goto err; > if (read(from, buf, bufsize) != bufsize) > goto err; >@@ -775,7 +775,7 @@ static int copy_metadata1(struct supertype *st, int from, int to) > calc_sb_1_csum(sb) != super.sb_csum) > goto err; > >- if (lseek64(to, sb_offset << 9, 0) < 0LL) >+ if (lseek(to, sb_offset << 9, 0) < 0LL) > goto err; > if (write(to, buf, bufsize) != bufsize) > goto err; >@@ -791,9 +791,9 @@ static int copy_metadata1(struct supertype *st, int from, int to) > > bitmap_offset += (int32_t)__le32_to_cpu(super.bitmap_offset); > >- if (lseek64(from, bitmap_offset<<9, 0) < 0) >+ if (lseek(from, bitmap_offset<<9, 0) < 0) > goto err; >- if (lseek64(to, bitmap_offset<<9, 0) < 0) >+ if (lseek(to, bitmap_offset<<9, 0) < 0) > goto err; > > for (written = 0; written < bytes ; ) { >@@ -832,9 +832,9 @@ static int copy_metadata1(struct supertype *st, int from, int to) > > bb_offset += (int32_t)__le32_to_cpu(super.bblog_offset); > >- if (lseek64(from, bb_offset<<9, 0) < 0) >+ if (lseek(from, bb_offset<<9, 0) < 0) > goto err; >- if (lseek64(to, bb_offset<<9, 0) < 0) >+ if (lseek(to, bb_offset<<9, 0) < 0) > goto err; > > for (written = 0; written < bytes ; ) { >@@ -940,7 +940,7 @@ static int examine_badblocks_super1(struct supertype *st, int fd, char *devname) > offset = __le64_to_cpu(sb->super_offset) + > (int)__le32_to_cpu(sb->bblog_offset); > offset <<= 9; >- if (lseek64(fd, offset, 0) < 0) { >+ if (lseek(fd, offset, 0) < 0) { > pr_err("Cannot seek to bad-blocks list\n"); > return 1; > } >@@ -1797,7 +1797,7 @@ static int store_super1(struct supertype *st, int fd) > abort(); > } > >- if (lseek64(fd, sb_offset << 9, 0)< 0LL) >+ if (lseek(fd, sb_offset << 9, 0)< 0LL) > return 3; > > sbsize = ROUND_UP(sizeof(*sb) + 2 * __le32_to_cpu(sb->max_dev), 512); >@@ -1866,7 +1866,7 @@ static int write_init_ppl1(struct supertype *st, struct mdinfo *info, int fd) > sizeof(sb->set_uuid))); > ppl_hdr->checksum = __cpu_to_le32(~crc32c_le(~0, buf, PPL_HEADER_SIZE)); > >- if (lseek64(fd, info->ppl_sector * 512, SEEK_SET) < 0) { >+ if (lseek(fd, info->ppl_sector * 512, SEEK_SET) < 0) { > ret = errno; > perror("Failed to seek to PPL header location"); > } >@@ -1911,7 +1911,7 @@ static int write_empty_r5l_meta_block(struct supertype *st, int fd) > crc = crc32c_le(crc, (void *)mb, META_BLOCK_SIZE); > mb->checksum = crc; > >- if (lseek64(fd, __le64_to_cpu(sb->data_offset) * 512, 0) < 0LL) { >+ if (lseek(fd, __le64_to_cpu(sb->data_offset) * 512, 0) < 0LL) { > pr_err("cannot seek to offset of the meta block\n"); > goto fail_to_write; > } >@@ -2268,7 +2268,7 @@ static int load_super1(struct supertype *st, int fd, char *devname) > return -EINVAL; > } > >- if (lseek64(fd, sb_offset << 9, 0)< 0LL) { >+ if (lseek(fd, sb_offset << 9, 0)< 0LL) { > if (devname) > pr_err("Cannot seek to superblock on %s: %s\n", > devname, strerror(errno)); >@@ -2639,7 +2639,7 @@ static int locate_bitmap1(struct supertype *st, int fd, int node_num) > } > if (mustfree) > free(sb); >- lseek64(fd, offset<<9, 0); >+ lseek(fd, offset<<9, 0); > return ret; > } > >diff --git a/swap_super.c b/swap_super.c >index b6db574..9c39aff 100644 >--- a/swap_super.c >+++ b/swap_super.c >@@ -16,7 +16,7 @@ > > #define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) > >-extern long long lseek64(int, long long, int); >+extern long long lseek(int, long long, int); > > int main(int argc, char *argv[]) > { >@@ -38,8 +38,8 @@ int main(int argc, char *argv[]) > exit(1); > } > offset = MD_NEW_SIZE_SECTORS(size) * 512LL; >- if (lseek64(fd, offset, 0) < 0LL) { >- perror("lseek64"); >+ if (lseek(fd, offset, 0) < 0LL) { >+ perror("lseek"); > exit(1); > } > if (read(fd, super, 4096) != 4096) { >@@ -68,8 +68,8 @@ int main(int argc, char *argv[]) > super[32*4+10*4 +i] = t; > } > >- if (lseek64(fd, offset, 0) < 0LL) { >- perror("lseek64"); >+ if (lseek(fd, offset, 0) < 0LL) { >+ perror("lseek"); > exit(1); > } > if (write(fd, super, 4096) != 4096) { >diff --git a/util.c b/util.c >index 3d05d07..6109fd4 100644 >--- a/util.c >+++ b/util.c >@@ -2344,7 +2344,7 @@ int zero_disk_range(int fd, unsigned long long sector, size_t count) > return -1; > } > >- if (lseek64(fd, sector * 512, SEEK_SET) < 0) { >+ if (lseek(fd, sector * 512, SEEK_SET) < 0) { > ret = -errno; > pr_err("Failed to seek offset for zeroing\n"); > goto out;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 907082
:
862384
|
862385
|
862386
|
862387
|
862388
|
862389
|
862390
| 872995 |
874140