-#define vx_acc_cres_cond(x,d,p,r) \
- __vx_acc_cres(((x) == current->xid) ? current->vx_info : 0,\
- (r), (d), (p), __FILE__, __LINE__)
+#define vx_add_cres_cond(x,a,p,r) \
+ __vx_add_cres(((x) == vx_current_xid()) ? current->vx_info : 0, \
+ r, a, p, __FILE__, __LINE__)
+#define vx_sub_cres_cond(x,a,p,r) vx_add_cres_cond(x,-(a),p,r)
+
+
+static inline void __vx_add_cres(struct vx_info *vxi,
+ int res, int amount, void *_data, char *_file, int _line)
+{
+ if (VXD_RLIMIT(res, RLIMIT_MSGQUEUE))
+ vxlprintk(1, "vx_add_cres[%5d,%s,%2d]: %5d += %5d (%p)",
+ (vxi?vxi->vx_id:-1), vlimit_name[res], res,
+ (vxi?atomic_read(&vxi->limit.rcur[res]):0),
+ amount, _data, _file, _line);
+ if (amount == 0)
+ return;
+ if (vxi)
+ atomic_add(amount, &vxi->limit.rcur[res]);
+}
+
+
+/* process and file limits */