retire 64-bit conversion functions
Change-Id: Ib6b81403f877c363a286c654e0524fa1cb781b80
This commit is contained in:
+2
-2
@@ -93,7 +93,7 @@ int fs_readwrite(void)
|
||||
}
|
||||
|
||||
/* Read or write 'chunk' bytes. */
|
||||
r = rw_chunk(rip, cvul64((unsigned long) position), off, chunk,
|
||||
r = rw_chunk(rip, ((u64_t)((unsigned long)position)), off, chunk,
|
||||
nrbytes, rw_flag, gid, cum_io, block_size, &completed);
|
||||
|
||||
if (r != OK) break; /* EOF reached */
|
||||
@@ -453,7 +453,7 @@ void read_ahead()
|
||||
|
||||
assert(rdahedpos >= 0); /* So we can safely cast it to unsigned below */
|
||||
|
||||
bp = rahead(rip, b, cvul64((unsigned long) rdahedpos), block_size);
|
||||
bp = rahead(rip, b, ((u64_t)((unsigned long)rdahedpos)), block_size);
|
||||
put_block(bp, PARTIAL_DATA_BLOCK);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ register struct super_block *sp; /* pointer to a superblock */
|
||||
panic("can't allocate memory for super_block buffers");
|
||||
|
||||
assert(_MIN_BLOCK_SIZE <= sizeof(*ondisk_superblock));
|
||||
r = bdev_read(dev, cvu64(super_block_offset), (char*) ondisk_superblock,
|
||||
r = bdev_read(dev, ((u64_t)(super_block_offset)), (char*) ondisk_superblock,
|
||||
_MIN_BLOCK_SIZE, BDEV_NOFLAGS);
|
||||
|
||||
if (r != _MIN_BLOCK_SIZE)
|
||||
@@ -177,7 +177,7 @@ register struct super_block *sp; /* pointer to a superblock */
|
||||
gdt_position = (opt.block_with_super + 1) * 1024;
|
||||
}
|
||||
|
||||
r = bdev_read(dev, cvu64(gdt_position), (char*) ondisk_group_descs,
|
||||
r = bdev_read(dev, ((u64_t)(gdt_position)), (char*) ondisk_group_descs,
|
||||
gd_size, BDEV_NOFLAGS);
|
||||
if (r != (ssize_t) gd_size) {
|
||||
printf("Can not read group descriptors\n");
|
||||
@@ -230,7 +230,7 @@ struct super_block *sp; /* pointer to a superblock */
|
||||
|
||||
super_copy(ondisk_superblock, sp);
|
||||
|
||||
r = bdev_write(sp->s_dev, cvu64(super_block_offset), (char *) sp,
|
||||
r = bdev_write(sp->s_dev, ((u64_t)(super_block_offset)), (char *) sp,
|
||||
SUPER_SIZE_D, BDEV_NOFLAGS);
|
||||
if (r != SUPER_SIZE_D)
|
||||
printf("ext2: Warning, failed to write superblock to the disk!\n");
|
||||
@@ -248,7 +248,7 @@ struct super_block *sp; /* pointer to a superblock */
|
||||
copy_group_descriptors(ondisk_group_descs, sp->s_group_desc,
|
||||
sp->s_groups_count);
|
||||
|
||||
r = bdev_write(sp->s_dev, cvu64(gdt_position),
|
||||
r = bdev_write(sp->s_dev, ((u64_t)(gdt_position)),
|
||||
(char*) ondisk_group_descs, gd_size, BDEV_NOFLAGS);
|
||||
if (r != (ssize_t) gd_size) {
|
||||
printf("Can not write group descriptors\n");
|
||||
|
||||
@@ -54,7 +54,7 @@ int fs_read(void) {
|
||||
if (chunk > bytes_left) chunk = (int) bytes_left;
|
||||
|
||||
/* Read or write 'chunk' bytes. */
|
||||
r = read_chunk(dir, cvul64(position), off, chunk, (unsigned) nrbytes,
|
||||
r = read_chunk(dir, ((u64_t)(position)), off, chunk, (unsigned) nrbytes,
|
||||
gid, cum_io, block_size, &completed, rw);
|
||||
|
||||
if (r != OK) break; /* EOF reached */
|
||||
|
||||
@@ -91,7 +91,7 @@ int read_vds(
|
||||
static char sbbuf[ISO9660_MIN_BLOCK_SIZE];
|
||||
int i = 0;
|
||||
|
||||
offset = cvul64(ISO9660_SUPER_BLOCK_POSITION);
|
||||
offset = ((u64_t)(ISO9660_SUPER_BLOCK_POSITION));
|
||||
while (!vol_ok && i++<MAX_ATTEMPTS) {
|
||||
|
||||
/* Read the sector of the super block. */
|
||||
@@ -101,7 +101,7 @@ int read_vds(
|
||||
continue;
|
||||
|
||||
if ((sbbuf[0] & BYTE) == VD_PRIMARY) {
|
||||
create_v_pri(v_pri,sbbuf,cv64ul(offset)); /* copy the buffer in the data structure. */
|
||||
create_v_pri(v_pri,sbbuf,offset); /* copy the buffer in the data structure. */
|
||||
}
|
||||
|
||||
if ((sbbuf[0] & BYTE) == VD_SET_TERM)
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ int fs_readwrite(void)
|
||||
}
|
||||
|
||||
/* Read or write 'chunk' bytes. */
|
||||
r = rw_chunk(rip, cvul64((unsigned long) position), off, chunk,
|
||||
r = rw_chunk(rip, ((u64_t)((unsigned long)position)), off, chunk,
|
||||
nrbytes, rw_flag, gid, cum_io, block_size, &completed);
|
||||
|
||||
if (r != OK) break; /* EOF reached */
|
||||
|
||||
+2
-2
@@ -214,10 +214,10 @@ static int rw_super(struct super_block *sp, int writing)
|
||||
if(writing) {
|
||||
memset(sbbuf, 0, _MIN_BLOCK_SIZE);
|
||||
memcpy(sbbuf, sp, ondisk_bytes);
|
||||
r = bdev_write(sp->s_dev, cvu64(SUPER_BLOCK_BYTES), sbbuf, _MIN_BLOCK_SIZE,
|
||||
r = bdev_write(sp->s_dev, ((u64_t)(SUPER_BLOCK_BYTES)), sbbuf, _MIN_BLOCK_SIZE,
|
||||
BDEV_NOFLAGS);
|
||||
} else {
|
||||
r = bdev_read(sp->s_dev, cvu64(SUPER_BLOCK_BYTES), sbbuf, _MIN_BLOCK_SIZE,
|
||||
r = bdev_read(sp->s_dev, ((u64_t)(SUPER_BLOCK_BYTES)), sbbuf, _MIN_BLOCK_SIZE,
|
||||
BDEV_NOFLAGS);
|
||||
memset(sp, 0, sizeof(*sp));
|
||||
memcpy(sp, sbbuf, ondisk_bytes);
|
||||
|
||||
@@ -680,7 +680,7 @@ int do_ioctl(message *UNUSED(m_out))
|
||||
if (S_ISBLK(vp->v_mode))
|
||||
r = bdev_ioctl(dev, who_e, ioctlrequest, argx);
|
||||
else
|
||||
r = dev_io(VFS_DEV_IOCTL, dev, who_e, argx, cvu64(0),
|
||||
r = dev_io(VFS_DEV_IOCTL, dev, who_e, argx, ((u64_t)(0)),
|
||||
ioctlrequest, f->filp_flags, suspend_reopen);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -567,7 +567,7 @@ char path[PATH_MAX]; /* path to script file */
|
||||
pos = 0; /* Read from the start of the file */
|
||||
|
||||
/* Issue request */
|
||||
r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, cvul64(pos), READING,
|
||||
r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, ((u64_t)(pos)), READING,
|
||||
VFS_PROC_NR, buf, _MAX_BLOCK_SIZE, &new_pos, &cum_io);
|
||||
if (r != OK) return(r);
|
||||
|
||||
@@ -692,7 +692,7 @@ static int read_seg(struct exec_info *execi, off_t off, off_t seg_addr, size_t s
|
||||
if (off + seg_bytes > LONG_MAX) return(EIO);
|
||||
if ((unsigned long) vp->v_size < off+seg_bytes) return(EIO);
|
||||
|
||||
if ((r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, cvul64(off), READING,
|
||||
if ((r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, ((u64_t)(off)), READING,
|
||||
execi->proc_e, (char*)seg_addr, seg_bytes,
|
||||
&new_pos, &cum_io)) != OK) {
|
||||
printf("VFS: read_seg: req_readwrite failed (data)\n");
|
||||
@@ -739,7 +739,7 @@ static int map_header(struct vfs_exec_info *execi)
|
||||
execi->args.hdr = hdr;
|
||||
|
||||
r = req_readwrite(execi->vp->v_fs_e, execi->vp->v_inode_nr,
|
||||
cvul64(pos), READING, VFS_PROC_NR, hdr,
|
||||
((u64_t)(pos)), READING, VFS_PROC_NR, hdr,
|
||||
execi->args.hdr_len, &new_pos, &cum_io);
|
||||
if (r != OK) {
|
||||
printf("VFS: exec: map_header: req_readwrite failed\n");
|
||||
|
||||
@@ -177,7 +177,7 @@ int get_fd(struct fproc *rfp, int start, mode_t bits, int *k, struct filp **fpt)
|
||||
assert(f->filp_count >= 0);
|
||||
if (f->filp_count == 0 && mutex_trylock(&f->filp_lock) == 0) {
|
||||
f->filp_mode = bits;
|
||||
f->filp_pos = cvu64(0);
|
||||
f->filp_pos = ((u64_t)(0));
|
||||
f->filp_selectors = 0;
|
||||
f->filp_select_ops = 0;
|
||||
f->filp_pipe_select_ops = 0;
|
||||
|
||||
+4
-4
@@ -608,9 +608,9 @@ int actual_lseek(message *m_out, int seekfd, int seekwhence, off_t offset)
|
||||
|
||||
/* The value of 'whence' determines the start position to use. */
|
||||
switch(seekwhence) {
|
||||
case SEEK_SET: pos = cvu64(0); break;
|
||||
case SEEK_SET: pos = ((u64_t)(0)); break;
|
||||
case SEEK_CUR: pos = rfilp->filp_pos; break;
|
||||
case SEEK_END: pos = cvul64(rfilp->filp_vno->v_size); break;
|
||||
case SEEK_END: pos = ((u64_t)(rfilp->filp_vno->v_size)); break;
|
||||
default: unlock_filp(rfilp); return(EINVAL);
|
||||
}
|
||||
|
||||
@@ -675,9 +675,9 @@ int actual_llseek(struct fproc *rfp, message *m_out, int seekfd, int seekwhence,
|
||||
|
||||
/* The value of 'whence' determines the start position to use. */
|
||||
switch(seekwhence) {
|
||||
case SEEK_SET: pos = cvu64(0); break;
|
||||
case SEEK_SET: pos = ((u64_t)(0)); break;
|
||||
case SEEK_CUR: pos = rfilp->filp_pos; break;
|
||||
case SEEK_END: pos = cvul64(rfilp->filp_vno->v_size); break;
|
||||
case SEEK_END: pos = ((u64_t)(rfilp->filp_vno->v_size)); break;
|
||||
default: unlock_filp(rfilp); return(EINVAL);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -205,7 +205,7 @@ int read_write(struct fproc *rfp, int rw_flag, struct filp *f,
|
||||
} else { /* Regular files */
|
||||
if (rw_flag == WRITING) {
|
||||
/* Check for O_APPEND flag. */
|
||||
if (f->filp_flags & O_APPEND) position = cvul64(vp->v_size);
|
||||
if (f->filp_flags & O_APPEND) position = ((u64_t)(vp->v_size));
|
||||
}
|
||||
|
||||
/* Issue request */
|
||||
@@ -315,7 +315,7 @@ size_t req_size;
|
||||
|
||||
oflags = f->filp_flags;
|
||||
vp = f->filp_vno;
|
||||
position = cvu64(0); /* Not actually used */
|
||||
position = ((u64_t)(0)); /* Not actually used */
|
||||
|
||||
assert(rw_flag == READING || rw_flag == WRITING);
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ int req_getdents(
|
||||
cpf_revoke(grant_id);
|
||||
|
||||
if (r == OK) {
|
||||
*new_pos = cvul64(m.RES_SEEK_POS_LO);
|
||||
*new_pos = ((u64_t)(m.RES_SEEK_POS_LO));
|
||||
r = m.RES_NBYTES;
|
||||
}
|
||||
|
||||
@@ -808,7 +808,7 @@ unsigned int *cum_iop;
|
||||
|
||||
if (r == OK) {
|
||||
/* Fill in response structure */
|
||||
*new_posp = cvul64(m.RES_SEEK_POS_LO);
|
||||
*new_posp = ((u64_t)(m.RES_SEEK_POS_LO));
|
||||
*cum_iop = m.RES_NBYTES;
|
||||
}
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ static int select_request_async(struct filp *f, int *ops, int block)
|
||||
|
||||
f->filp_select_flags &= ~FSF_UPDATE;
|
||||
r = dev_io(VFS_DEV_SELECT, f->filp_vno->v_sdev, rops, NULL,
|
||||
cvu64(0), 0, 0, FALSE);
|
||||
((u64_t)(0)), 0, 0, FALSE);
|
||||
if (r < 0 && r != SUSPEND)
|
||||
return(r);
|
||||
|
||||
@@ -435,7 +435,7 @@ static int select_request_sync(struct filp *f, int *ops, int block)
|
||||
rops = *ops;
|
||||
if (block) rops |= SEL_NOTIFY;
|
||||
*ops = dev_io(VFS_DEV_SELECT, f->filp_vno->v_sdev, rops, NULL,
|
||||
cvu64(0), 0, 0, FALSE);
|
||||
((u64_t)(0)), 0, 0, FALSE);
|
||||
if (*ops < 0)
|
||||
return(*ops);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user