diff options
author | glenda <glenda@9front.local> | 2022-08-09 17:47:39 +0000 |
---|---|---|
committer | glenda <glenda@9front.local> | 2022-08-09 17:47:39 +0000 |
commit | db27bd5be753519505973cc0226e3a49ef5aa23e (patch) | |
tree | 2c1fc6cc3830f65424282c7a58f57c99f391acef /sys/src/9/port | |
parent | 7e0cdf428a5c2a349293d973b0d07a1affa31e27 (diff) |
kernel: use 64 bits for mountids
We dont expose this anymore, wrapping
these would be bad. Just send more bits.
Diffstat (limited to 'sys/src/9/port')
-rw-r--r-- | sys/src/9/port/pgrp.c | 17 | ||||
-rw-r--r-- | sys/src/9/port/portdat.h | 2 |
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/src/9/port/pgrp.c b/sys/src/9/port/pgrp.c index afb50d9cf..55c357569 100644 --- a/sys/src/9/port/pgrp.c +++ b/sys/src/9/port/pgrp.c @@ -9,7 +9,18 @@ enum { 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 @@ pgrpcpy(Pgrp *to, Pgrp *from) * 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 @@ newmount(Chan *to, int flag, char *spec) 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); diff --git a/sys/src/9/port/portdat.h b/sys/src/9/port/portdat.h index e9bb02f1e..e2aa2aa07 100644 --- a/sys/src/9/port/portdat.h +++ b/sys/src/9/port/portdat.h @@ -247,7 +247,7 @@ struct Walkqid struct Mount { - ulong mountid; + uvlong mountid; int mflag; Mount* next; Mount* order; |