ref: 7fee327ee530409dee0d36cb258927934ba97aff
parent: 903bcd8dba9cb9dfc70707a28089c469e5302539
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Aug 8 06:43:14 EDT 2025
kernel: rename RWlock to RWLock for consistency with userspace (thanks rodri)
--- a/kern/chan.c
+++ b/kern/chan.c
@@ -506,9 +506,9 @@
* - the mhead in chans returned from createdir:
* used in the open/create race protect, which is gone.
*
- * The RWlock in the Mhead protects the mount list it contains.
+ * The RWLock in the Mhead protects the mount list it contains.
* The mount list is deleted in cunmount() and closepgrp().
- * The RWlock ensures that nothing is using the mount list at that time.
+ * The RWLock ensures that nothing is using the mount list at that time.
*
* It is okay to replace c->mh with whatever you want as
* long as you are sure you have a unique reference to it.
--- a/kern/dat.h
+++ b/kern/dat.h
@@ -29,7 +29,7 @@
typedef struct Ref Ref;
typedef struct Rendez Rendez;
typedef struct Rgrp Rgrp;
-typedef struct RWlock RWlock;
+typedef struct RWLock RWLock;
typedef struct Waitq Waitq;
typedef struct Walkqid Walkqid;
typedef struct Kmesg Kmesg;
@@ -66,7 +66,7 @@
Proc *p;
};
-struct RWlock /* changed from kernel */
+struct RWLock /* changed from kernel */
{
int readers;
Lock lk;
@@ -249,7 +249,7 @@
struct Mhead
{
Ref ref;
- RWlock lock;
+ RWLock lock;
Chan* from; /* channel mounted upon */
Mount* mount; /* what's mounted upon it */
Mhead* hash; /* Hash chain */
@@ -293,7 +293,7 @@
Ref ref; /* also used as a lock when mounting */
int noattach;
QLock debug; /* single access via devproc.c */
- RWlock ns; /* Namespace n read/one write lock */
+ RWLock ns; /* Namespace n read/one write lock */
Mhead *mnthash[MNTHASH];
};
@@ -306,7 +306,7 @@
struct Egrp
{
Ref ref;
- RWlock lk;
+ RWLock lk;
Evalue **ent;
int nent;
int ment;
--- a/kern/fns.h
+++ b/kern/fns.h
@@ -8,7 +8,7 @@
int canlock(Lock*);
int canputc(void*);
int canqlock(QLock*);
-int canrlock(RWlock*);
+int canrlock(RWLock*);
void chandevinit(void);
void chandevreset(void);
void chandevshutdown(void);
@@ -187,8 +187,8 @@
int readnum(ulong, char*, ulong, ulong, int);
int readstr(ulong, char*, ulong, char*);
int return0(void*);
-void rlock(RWlock*);
-void runlock(RWlock*);
+void rlock(RWLock*);
+void runlock(RWLock*);
extern void (*screenputs)(char*, int);
void* secalloc(ulong);
void secfree(void*);
@@ -214,8 +214,8 @@
Proc* wakeup(Rendez*);
int walk(Chan**, char**, int, int, int*);
#define waserror() (setjmp(pwaserror()->buf))
-void wlock(RWlock*);
-void wunlock(RWlock*);
+void wlock(RWLock*);
+void wunlock(RWLock*);
void osyield(void);
void osmsleep(int);
ulong ticks(void);
--- a/kern/qlock.c
+++ b/kern/qlock.c
@@ -72,7 +72,7 @@
lock(&q->lk);
/*
- * Can't assert this because of RWlock
+ * Can't assert this because of RWLock
assert(q->hold == CT);
*/
p = dequeue((Proc**)&q->first, (Proc**)&q->last);
--- a/kern/rwlock.c
+++ b/kern/rwlock.c
@@ -5,7 +5,7 @@
#include "error.h"
void
-rlock(RWlock *l)
+rlock(RWLock *l)
{
qlock(&l->x); /* wait here for writers and exclusion */
lock(&l->lk);
@@ -16,7 +16,7 @@
}
void
-runlock(RWlock *l)
+runlock(RWLock *l)
{
lock(&l->lk);
if(--l->readers == 0) /* last reader out allows writers */
@@ -25,7 +25,7 @@
}
void
-wlock(RWlock *l)
+wlock(RWLock *l)
{
qlock(&l->x); /* wait here for writers and exclusion */
qlock(&l->k); /* wait here for last reader */
@@ -32,7 +32,7 @@
}
void
-wunlock(RWlock *l)
+wunlock(RWLock *l)
{
qunlock(&l->k);
qunlock(&l->x);
--
⑨