Commit c9ba6c31 authored by claes's avatar claes

Quota check added in enque

parent d22649b9
/* /*
* Proview $Id: rt_qcom.c,v 1.9 2008-01-25 14:34:18 claes Exp $ * Proview $Id: rt_qcom.c,v 1.10 2008-11-24 15:20:06 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -256,6 +256,8 @@ qcom_CreateQ ( ...@@ -256,6 +256,8 @@ qcom_CreateQ (
qid->nid = qdb->my_nid; qid->nid = qdb->my_nid;
qp->type = type; qp->type = type;
qp->flags.m = flags.m; qp->flags.m = flags.m;
if ( attr)
qp->in_quota = attr->quota;
qp = qdb_AttachQue(sts, qp, qdb->ap); qp = qdb_AttachQue(sts, qp, qdb->ap);
if (qp == NULL) break; if (qp == NULL) break;
if (flags.b.broadcast) { if (flags.b.broadcast) {
......
/* /*
* Proview $Id: rt_qdb.c,v 1.12 2008-09-05 08:59:23 claes Exp $ * Proview $Id: rt_qdb.c,v 1.13 2008-11-24 15:20:06 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -524,6 +524,11 @@ qdb_Enque ( ...@@ -524,6 +524,11 @@ qdb_Enque (
qdb_AssumeLocked; qdb_AssumeLocked;
if ( qp->in_quota && qp->in_lc >= qp->in_quota) {
*status = QDB__QUOTAEXCEEDED;
return 0;
}
pool_Qremove(sts, &qdb->pool, &bp->c.ll); pool_Qremove(sts, &qdb->pool, &bp->c.ll);
if (!bp->c.flags.b.remote && bp->c.flags.b.reply) { if (!bp->c.flags.b.remote && bp->c.flags.b.reply) {
if (qp->flags.b.reply && bp->b.info.rid == qp->rid) { if (qp->flags.b.reply && bp->b.info.rid == qp->rid) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment