ref: db27bd5be753519505973cc0226e3a49ef5aa23e
parent: 7e0cdf428a5c2a349293d973b0d07a1affa31e27
author: glenda <[email protected]>
date: Tue Aug 9 13:47:39 EDT 2022
kernel: use 64 bits for mountids We dont expose this anymore, wrapping these would be bad. Just send more bits.
--- a/sys/src/9/port/pgrp.c
+++ b/sys/src/9/port/pgrp.c
@@ -9,8 +9,19 @@
Whinesecs = 10, /* frequency of out-of-resources printing */
};
-static Ref mountid;
+uvlong
+nextmount(void)
+{
+ static uvlong next = 0;
+ static Lock lk;
+ uvlong n;
+ lock(&lk);
+ n = ++next;
+ unlock(&lk);
+ return n;
+}
+
Pgrp*
newpgrp(void)
{
@@ -119,7 +130,7 @@
* Allocate mount ids in the same sequence as the parent group
*/
for(m = order; m != nil; m = m->order)
- m->mountid = incref(&mountid);
+ m->mountid = nextmount();
runlock(&from->ns);
wunlock(&to->ns);
}
@@ -239,7 +250,7 @@
m = smalloc(sizeof(Mount));
m->to = to;
incref(to);
- m->mountid = incref(&mountid);
+ m->mountid = nextmount();
m->mflag = flag;
if(spec != nil)
kstrdup(&m->spec, spec);
--- a/sys/src/9/port/portdat.h
+++ b/sys/src/9/port/portdat.h
@@ -247,7 +247,7 @@
struct Mount
{
- ulong mountid;
+ uvlong mountid;
int mflag;
Mount* next;
Mount* order;