5 #define VLIMIT_NSOCK 16
6 #define VLIMIT_OPENFD 17
8 #define VLIMIT_SHMEM 19
9 #define VLIMIT_SEMARY 20
10 #define VLIMIT_NSEMS 21
11 #define VLIMIT_DENTRY 22
15 #define VLIM_NOCHECK (1L << VLIMIT_DENTRY)
17 /* keep in sync with CRLIM_INFINITY */
19 #define VLIM_INFINITY (~0ULL)
22 #warning RLIM_INFINITY is undefined
25 #define __rlim_val(l,r,v) ((l)->res[(r)].v)
27 #define __rlim_soft(l,r) __rlim_val(l,r,soft)
28 #define __rlim_hard(l,r) __rlim_val(l,r,hard)
30 #define __rlim_rcur(l,r) __rlim_val(l,r,rcur)
31 #define __rlim_rmin(l,r) __rlim_val(l,r,rmin)
32 #define __rlim_rmax(l,r) __rlim_val(l,r,rmax)
34 #define __rlim_lhit(l,r) __rlim_val(l,r,lhit)
35 #define __rlim_hit(l,r) atomic_inc(&__rlim_lhit(l,r))
37 typedef atomic_long_t rlim_atomic_t;
38 typedef unsigned long rlim_t;
40 #define __rlim_get(l,r) atomic_long_read(&__rlim_rcur(l,r))
41 #define __rlim_set(l,r,v) atomic_long_set(&__rlim_rcur(l,r), v)
42 #define __rlim_inc(l,r) atomic_long_inc(&__rlim_rcur(l,r))
43 #define __rlim_dec(l,r) atomic_long_dec(&__rlim_rcur(l,r))
44 #define __rlim_add(l,r,v) atomic_long_add(v, &__rlim_rcur(l,r))
45 #define __rlim_sub(l,r,v) atomic_long_sub(v, &__rlim_rcur(l,r))
48 #if (RLIM_INFINITY == VLIM_INFINITY)
49 #define VX_VLIM(r) ((long long)(long)(r))
50 #define VX_RLIM(v) ((rlim_t)(v))
52 #define VX_VLIM(r) (((r) == RLIM_INFINITY) \
53 ? VLIM_INFINITY : (long long)(r))
54 #define VX_RLIM(v) (((v) == VLIM_INFINITY) \
55 ? RLIM_INFINITY : (rlim_t)(v))
60 void vx_vsi_meminfo(struct sysinfo *);
61 void vx_vsi_swapinfo(struct sysinfo *);
65 #endif /* __KERNEL__ */
66 #endif /* _VX_LIMIT_H */