76 lines
2.1 KiB
Plaintext
76 lines
2.1 KiB
Plaintext
|
This file describes use of resources and spin locks with the netware
|
||
|
redirector. There are 2 major sections - global locks, and per structure
|
||
|
locks. Each subsection names a lock or resources and list all of the
|
||
|
global variable, and structure fields it protects.
|
||
|
|
||
|
|
||
|
1. Global Locks
|
||
|
|
||
|
1.1 ScbSpinLock
|
||
|
- ScbQueue
|
||
|
- NpScb fields -> ScbLinks
|
||
|
- Nearest server table.
|
||
|
|
||
|
1.2 Rcb->Resource
|
||
|
- ServerNameTable
|
||
|
- FileNameTable, Fcb->PrefixEntry
|
||
|
- Rcb fields -> OpenCount
|
||
|
- Synchronize access to newly created FCBs
|
||
|
- DefaultUserName, DefaultPassword, DefaultServerName.
|
||
|
- Fcb->IcbList, Icb->ListEntry
|
||
|
- DriveMapTable
|
||
|
- Vcb->ReferenceCount, Vcb->FcbList, Vcb->FcbCount, GlobalVcbListEntry
|
||
|
- Scb->ScbSpecificVcbQueue, Scb->VcbCount, OpenFileCount, AttachCount
|
||
|
- GlobalVcbList, CurrentVcbEntry
|
||
|
- LogonList
|
||
|
|
||
|
1.3 NwScavengerSpinLock
|
||
|
- NwScavengerTickCount
|
||
|
|
||
|
1.4 Front of the SCB queue
|
||
|
- Icb->State, HasRemoteHandle
|
||
|
- NpScb->State
|
||
|
- pScb->UserName, pScb->Password
|
||
|
- Fcb->FileSize (except during create)
|
||
|
|
||
|
1.5 NwMessageSpinLock
|
||
|
- NwGetMessageList
|
||
|
|
||
|
1.6 NwPendingLockSpinLock
|
||
|
- NwPendingLockList
|
||
|
|
||
|
1.7 NwFcbTableResource
|
||
|
- FCB / ICB creation.
|
||
|
|
||
|
2. Per structure locks
|
||
|
|
||
|
2.1 SCB->NpScbSpinLock
|
||
|
- NpScb fields -> Sending, Receiving, OkToReceive, TimeOut,
|
||
|
MaxTimeOut, Requests, RetryCount, Reference
|
||
|
|
||
|
2.2 FCB->Resource
|
||
|
- Fcb-> Attributes, LastModifiedDate, LastModifiedTime
|
||
|
State, FileLockList, PendingLockList,
|
||
|
|
||
|
2.3 Front of the SCB queue
|
||
|
- Icb->FileLockList
|
||
|
|
||
|
2.4 LOGON->CredListResource
|
||
|
Protects the credentials on the cred list
|
||
|
and the list pointers. Acquire shared for
|
||
|
read access to the list. Acquire exclusive
|
||
|
for write access to the list.
|
||
|
|
||
|
In order to eliminate dead locks, locks should be acquired in the following
|
||
|
order (if multiple locks are needed).
|
||
|
|
||
|
RCB->Resource
|
||
|
FCB->Resource
|
||
|
NwScavengerSpinLock
|
||
|
LOGON->CredListResource
|
||
|
ScbSpinLock
|
||
|
SCB->NpScbSpinLock
|
||
|
|
||
|
A thread cannot wait for the SCB queue while holding any other lock.
|
||
|
|