Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/freebsd32/freebsd32_misc.c
Show First 20 Lines • Show All 3,575 Lines • ▼ Show 20 Lines | freebsd32_posix_fallocate(struct thread *td, | ||||
int error; | int error; | ||||
error = kern_posix_fallocate(td, uap->fd, | error = kern_posix_fallocate(td, uap->fd, | ||||
PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len)); | PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len)); | ||||
return (kern_posix_error(td, error)); | return (kern_posix_error(td, error)); | ||||
} | } | ||||
int | int | ||||
freebsd32_posix_fadvise(struct thread *td, | freebsd32_posix_fadvise(struct thread *td, | ||||
brooks: With the removal of `spacectl_range32` this whole function is redundant. | |||||
struct freebsd32_posix_fadvise_args *uap) | struct freebsd32_posix_fadvise_args *uap) | ||||
{ | { | ||||
int error; | int error; | ||||
error = kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), | error = kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), | ||||
PAIR32TO64(off_t, uap->len), uap->advice); | PAIR32TO64(off_t, uap->len), uap->advice); | ||||
return (kern_posix_error(td, error)); | return (kern_posix_error(td, error)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | if (error == 0) { | ||||
timex_to_32(&tx32, &tx); | timex_to_32(&tx32, &tx); | ||||
error = copyout(&tx32, uap->tp, sizeof(tx32)); | error = copyout(&tx32, uap->tp, sizeof(tx32)); | ||||
if (error == 0) | if (error == 0) | ||||
td->td_retval[0] = retval; | td->td_retval[0] = retval; | ||||
} | } | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
int | |||||
freebsd32_fspacectl(struct thread *td, struct freebsd32_fspacectl_args *uap) | |||||
{ | |||||
struct spacectl_range rqsr, rmsr; | |||||
struct spacectl_range32 rqsr32, rmsr32; | |||||
int error, cerror; | |||||
error = copyin(uap->rqsr, &rqsr32, sizeof(rqsr32)); | |||||
if (error != 0) | |||||
return (error); | |||||
rqsr.r_offset = PAIR32TO64(off_t, rqsr32.r_offset); | |||||
rqsr.r_len = PAIR32TO64(off_t, rqsr32.r_len); | |||||
error = kern_fspacectl(td, uap->fd, uap->cmd, &rqsr, uap->flags, | |||||
&rmsr); | |||||
if (uap->rmsr != NULL) { | |||||
Done Inline ActionsThis condition is still not fixed. BTW, I suggest to remove the error != 0 check at all. Copy *rqsr into *rmsr at the very beginning of kern_fspacectl() if rmsr != NULL, and it should be fine. kib: This condition is still not fixed.
BTW, I suggest to remove the error != 0 check at all. Copy… | |||||
#if BYTE_ORDER == LITTLE_ENDIAN | |||||
rmsr32.r_offset1 = rmsr.r_offset; | |||||
rmsr32.r_offset2 = rmsr.r_offset >> 32; | |||||
rmsr32.r_len1 = rmsr.r_len; | |||||
rmsr32.r_len2 = rmsr.r_len >> 32; | |||||
#else | |||||
rmsr32.r_offset1 = rmsr.r_offset >> 32; | |||||
rmsr32.r_offset2 = rmsr.r_offset; | |||||
rmsr32.r_len1 = rmsr.r_len >> 32; | |||||
rmsr32.r_len2 = rmsr.r_len; | |||||
#endif | |||||
cerror = copyout(&rmsr32, uap->rmsr, sizeof(rmsr32)); | |||||
if (error == 0) | |||||
error = cerror; | |||||
} | |||||
return (error); | |||||
} |
With the removal of spacectl_range32 this whole function is redundant.