flck.l_type = F_FREESP;
flck.l_start = zio->io_offset;
flck.l_len = zio->io_size;
- flck.l_whence = 0;
+ flck.l_whence = SEEK_SET;
zio->io_error = VOP_SPACE(vf->vf_vnode, F_FREESP, &flck,
0, 0, kcred, NULL);
vattr_t vap;
int error;
- if ((lckdat->l_whence == 2) || (whence == 2)) {
+ if ((lckdat->l_whence == SEEK_END) || (whence == SEEK_END)) {
if ((error = zfs_getattr(ip, &vap, 0, CRED())))
return (error);
}
switch (lckdat->l_whence) {
- case 1:
+ case SEEK_CUR:
lckdat->l_start += offset;
break;
- case 2:
+ case SEEK_END:
lckdat->l_start += vap.va_size;
/* FALLTHRU */
- case 0:
+ case SEEK_SET:
break;
default:
return (SET_ERROR(EINVAL));
return (SET_ERROR(EINVAL));
switch (whence) {
- case 1:
+ case SEEK_CUR:
lckdat->l_start -= offset;
break;
- case 2:
+ case SEEK_END:
lckdat->l_start -= vap.va_size;
/* FALLTHRU */
- case 0:
+ case SEEK_SET:
break;
default:
return (SET_ERROR(EINVAL));
return (SET_ERROR(EROFS));
}
- if ((error = convoff(ip, bfp, 0, offset))) {
+ if ((error = convoff(ip, bfp, SEEK_SET, offset))) {
ZFS_EXIT(zfsvfs);
return (error);
}