mirror of
https://github.com/vivier/EMILE.git
synced 2024-09-07 13:54:29 +00:00
correct numblocks in file
This commit is contained in:
parent
0ce05233d3
commit
7d3526ce23
@ -126,7 +126,6 @@ int emile_scsi_create_container(int fd, struct emile_container* container)
|
|||||||
int logical;
|
int logical;
|
||||||
int physical;
|
int physical;
|
||||||
int last_physical;
|
int last_physical;
|
||||||
int num_blocks;
|
|
||||||
int zone;
|
int zone;
|
||||||
int aggregate;
|
int aggregate;
|
||||||
int dev;
|
int dev;
|
||||||
@ -170,9 +169,10 @@ int emile_scsi_create_container(int fd, struct emile_container* container)
|
|||||||
|
|
||||||
/* seek all physical blocks */
|
/* seek all physical blocks */
|
||||||
|
|
||||||
num_blocks = (st.st_size + st.st_blksize - 1) / st.st_blksize;
|
|
||||||
current = 0;
|
current = 0;
|
||||||
for (logical = 1; logical < num_blocks; logical++) {
|
for (logical = 1;
|
||||||
|
logical < (st.st_size + block_size - 1) / block_size;
|
||||||
|
logical++) {
|
||||||
physical = logical;
|
physical = logical;
|
||||||
ret = ioctl(fd, FIBMAP, &physical);
|
ret = ioctl(fd, FIBMAP, &physical);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user