View | Details | Raw Unified | Return to bug 275436 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/fs/tmpfs/tmpfs_subr.c (-1 / +7 lines)
Lines 413-419 tmpfs_mem_avail(void) Link Here
413
	size_t avail;
413
	size_t avail;
414
	long reserved;
414
	long reserved;
415
415
416
	avail = swap_pager_avail + vm_free_count();
416
	avail = swap_pager_avail / 2 + vm_free_avail();
417
	reserved = atomic_load_long(&tmpfs_pages_reserved);
417
	reserved = atomic_load_long(&tmpfs_pages_reserved);
418
	if (__predict_false(avail < reserved))
418
	if (__predict_false(avail < reserved))
419
		return (0);
419
		return (0);
Lines 1862-1867 tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr) Link Here
1862
		if (newpages < oldpages)
1862
		if (newpages < oldpages)
1863
			vm_object_page_remove(uobj, newpages, 0, 0);
1863
			vm_object_page_remove(uobj, newpages, 0, 0);
1864
	}
1864
	}
1865
	if (newpages > oldpages) {
1866
		if (tmpfs_mem_avail() < newpages - oldpages) {
1867
			VM_OBJECT_WUNLOCK(uobj);
1868
			return (ENOSPC);
1869
		}
1870
	}
1865
	uobj->size = newpages;
1871
	uobj->size = newpages;
1866
	VM_OBJECT_WUNLOCK(uobj);
1872
	VM_OBJECT_WUNLOCK(uobj);
1867
1873
(-)b/sys/sys/vmmeter.h (+1 lines)
Lines 166-171 vm_wire_sub(int cnt) Link Here
166
	VM_CNT_ADD(v_wire_count, -cnt);
166
	VM_CNT_ADD(v_wire_count, -cnt);
167
}
167
}
168
168
169
u_int vm_free_avail(void);
169
u_int vm_free_count(void);
170
u_int vm_free_count(void);
170
static inline u_int
171
static inline u_int
171
vm_wire_count(void)
172
vm_wire_count(void)
(-)b/sys/vm/vm_meter.c (+10 lines)
Lines 424-429 vm_free_count(void) Link Here
424
	return (v);
424
	return (v);
425
}
425
}
426
426
427
u_int
428
vm_free_avail(void)
429
{
430
	u_int free = vm_free_count();
431
432
	if (free <= vm_cnt.v_free_target)
433
		return (0);
434
	return (free - vm_cnt.v_free_target);
435
}
436
427
static u_int
437
static u_int
428
vm_pagequeue_count(int pq)
438
vm_pagequeue_count(int pq)
429
{
439
{

Return to bug 275436