View | Details | Raw Unified | Return to bug 204438
Collapse All | Expand All

(-)/tmp/uipc_sockbuf.c (-5 / +9 lines)
Lines 397-403 Link Here
397
	sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES);
397
	sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES);
398
	return (0);
398
	return (0);
399
}
399
}
400
	
400
401
/*
401
/*
402
 * Allot mbufs to a sockbuf.  Attempt to scale mbmax so that mbcnt doesn't
402
 * Allot mbufs to a sockbuf.  Attempt to scale mbmax so that mbcnt doesn't
403
 * become limiting if buffering efficiency is near the normal case.
403
 * become limiting if buffering efficiency is near the normal case.
Lines 417-424 Link Here
417
	 * appropriate thread resource limits are available.  In that case,
417
	 * appropriate thread resource limits are available.  In that case,
418
	 * we don't apply a process limit.
418
	 * we don't apply a process limit.
419
	 */
419
	 */
420
	if (cc > sb_max_adj)
420
    if (cc > sb_max)
421
		return (0);
421
        return (0);
422
423
    if (cc > sb_max_adj)
424
        cc = sb_max_adj;
425
422
	if (td != NULL) {
426
	if (td != NULL) {
423
		sbsize_limit = lim_cur(td, RLIMIT_SBSIZE);
427
		sbsize_limit = lim_cur(td, RLIMIT_SBSIZE);
424
	} else
428
	} else
Lines 433-439 Link Here
433
}
437
}
434
438
435
int
439
int
436
sbreserve(struct sockbuf *sb, u_long cc, struct socket *so, 
440
sbreserve(struct sockbuf *sb, u_long cc, struct socket *so,
437
    struct thread *td)
441
    struct thread *td)
438
{
442
{
439
	int error;
443
	int error;
Lines 1297-1303 Link Here
1297
	xsb->sb_cc = sb->sb_ccc;
1301
	xsb->sb_cc = sb->sb_ccc;
1298
	xsb->sb_hiwat = sb->sb_hiwat;
1302
	xsb->sb_hiwat = sb->sb_hiwat;
1299
	xsb->sb_mbcnt = sb->sb_mbcnt;
1303
	xsb->sb_mbcnt = sb->sb_mbcnt;
1300
	xsb->sb_mcnt = sb->sb_mcnt;	
1304
	xsb->sb_mcnt = sb->sb_mcnt;
1301
	xsb->sb_ccnt = sb->sb_ccnt;
1305
	xsb->sb_ccnt = sb->sb_ccnt;
1302
	xsb->sb_mbmax = sb->sb_mbmax;
1306
	xsb->sb_mbmax = sb->sb_mbmax;
1303
	xsb->sb_lowat = sb->sb_lowat;
1307
	xsb->sb_lowat = sb->sb_lowat;

Return to bug 204438