1 #ifndef _VX_LIMIT_PROC_H
2 #define _VX_LIMIT_PROC_H
5 static inline void vx_limit_fixup(struct _vx_limit *limit)
10 for (lim=0; lim<NUM_LIMITS; lim++) {
11 value = atomic_read(&limit->rcur[lim]);
12 if (value > limit->rmax[lim])
13 limit->rmax[lim] = value;
14 if (limit->rmax[lim] > limit->rlim[lim])
15 limit->rmax[lim] = limit->rlim[lim];
19 #define VX_LIMIT_FMT ":\t%10d\t%10ld\t%10ld\t%6d\n"
21 #define VX_LIMIT_ARG(r) \
22 ,atomic_read(&limit->rcur[r]) \
25 ,atomic_read(&limit->lhit[r])
27 static inline int vx_info_proc_limit(struct _vx_limit *limit, char *buffer)
29 vx_limit_fixup(limit);
30 return sprintf(buffer,
42 VX_LIMIT_ARG(RLIMIT_NPROC)
43 VX_LIMIT_ARG(RLIMIT_AS)
44 VX_LIMIT_ARG(RLIMIT_MEMLOCK)
45 VX_LIMIT_ARG(RLIMIT_RSS)
46 VX_LIMIT_ARG(VLIMIT_ANON)
47 VX_LIMIT_ARG(RLIMIT_NOFILE)
48 VX_LIMIT_ARG(VLIMIT_OPENFD)
49 VX_LIMIT_ARG(RLIMIT_LOCKS)
50 VX_LIMIT_ARG(VLIMIT_NSOCK)
51 VX_LIMIT_ARG(RLIMIT_MSGQUEUE)
52 VX_LIMIT_ARG(VLIMIT_SHMEM)
56 #endif /* _VX_LIMIT_PROC_H */