Lines Matching defs:length

91 static int  do_hfs_truncate(struct vnode *vp, off_t length, int flags, int skip, vfs_context_t context);
2799 * individual swapfiles are maintained at fixed-length sizes by the VM code.
2838 do_hfs_truncate(struct vnode *vp, off_t length, int flags, int skipupdate, vfs_context_t context)
2858 (int)length, (int)fp->ff_size, (int)filebytes, 0, 0);
2860 if (length < 0)
2867 if ((!ISHFSPLUS(VTOVCB(vp))) && (length > (off_t)MAXHFSFILESIZE))
2880 * We cannot just check if fp->ff_size == length (as an optimization)
2891 * value of ff_size is 0, length will be at least 1.
2893 if (length > (off_t)fp->ff_size) {
2895 retval = hfs_chkdq(cp, (int64_t)(roundup(length - filebytes, blksize)),
2904 if (length > filebytes) {
2934 while ((length > filebytes) && (retval == E_NONE)) {
2935 bytesToAdd = length - filebytes;
2945 if (length > filebytes)
2946 length = filebytes;
2969 (int)length, (int)fp->ff_size, (int)filebytes, 0, 0);
2978 if (length < zero_limit) zero_limit = length;
2980 if (length > (off_t)fp->ff_size) {
3001 if (length > zero_limit) {
3003 rl_add(zero_limit, length - 1, &fp->ff_invalidranges);
3012 rl_add(fp->ff_size, length - 1, &fp->ff_invalidranges);
3021 fp->ff_size = length;
3025 if ((off_t)fp->ff_size > length) {
3027 rl_remove(length, fp->ff_size - 1, &fp->ff_invalidranges);
3032 * file length can still end up with unmapped blocks.
3047 finalblks = (length + blksize - 1) / blksize;
3082 retval = MacToVFSError(TruncateFileC(VTOVCB(vp), (FCB*)fp, length, 0,
3089 fp->ff_size = length;
3109 /* Only set update flag if the logical length changes */
3110 if ((off_t)fp->ff_size != length)
3112 fp->ff_size = length;
3136 (int)length, (int)fp->ff_size, (int)filebytes, retval, 0);
3181 * We cannot just check if fp->ff_size == length (as an optimization)
3341 * Truncate a cnode to at most length size, freeing (or adding) the
3345 hfs_truncate(struct vnode *vp, off_t length, int flags, int skipsetsize,
3359 if (vnode_isswap(vp) && (length != 0)) {
3375 // Even if skipsetsize is set, if the length is zero we
3383 if (!skipsetsize || length == 0)
3384 ubc_setsize(vp, length);
3390 if (length < filebytes) {
3391 while (filebytes > length) {
3392 if ((filebytes - length) > HFS_BIGFILE_SIZE && overflow_extents(fp)) {
3395 filebytes = length;
3402 } else if (length > filebytes) {
3403 while (filebytes < length) {
3404 if ((length - filebytes) > HFS_BIGFILE_SIZE && overflow_extents(fp)) {
3407 filebytes = length;
3416 error = do_hfs_truncate(vp, length, flags, skipupdate, context);
3445 off_t length = ap->a_length;
3463 if (length < (off_t)0)
3485 if ((ap->a_flags & ALLOCATEFROMVOL) && (length < filebytes)) {
3507 length += filebytes;
3512 if (filebytes == length)
3518 * value of filebytes is 0, length will be at least 1.
3520 if (length > filebytes) {
3523 orig_request_size = moreBytesRequested = length - filebytes;
3552 while ((length > filebytes) && (retval == E_NONE)) {
3626 if (fp->ff_size > length) {
3633 retval = hfs_truncate(vp, length, 0, 0, 0, ap->a_context);