一个东西,具体怎样联接,起到一个什么样的作用,还不是很明白...
An Lcb is used to connect an indexed Scb (i.e., a directory) to an Fcb and give it a name.
Each Scb will only have one parent Fcb but multiple Fcb children (each connected via an Lcb).
An Fcb can have multiple Scb parents (via Lcbs) and multiple Scb Children. ( can have multiple Scb parents??这里不解,还请高手指点)
In the following diagram we have two index scb (Scb1 and Scb2). The are two file opened under Scb1 both for the same File. The file was opened once with the name LcbA and another time with the name LcbB. Scb2 also has two opened file one is Fcb1 and named LcbC and the other is Fcb2 and named LcbD. Fcb1 has two opened Scbs under it (Scb3 and Scb4), and Fcb2 has one opened Scb underneath it (Scb5).
图1:
(如看不到图请复制下面链接到浏览器upload/attach/201005/193956_2e86d436f840c14b.jpg)
这幅图的下半部分我能理解,我的理解是Scb3、Scb4是Fcb1内的2个不同的属性流,Fcb通过LIST_ENTRY将其所有流链接起来.(Scb内部应该还有个Fcb的反向指针没有画).而Scb5是Fcb2的一次打开.
上半部分就看不懂了,我的理解是Scb1是Fcb1的父目录Fcb内的索引根属性流,或者索引分配属性流,可是就算是这样的话,那也应该只是只有一个Lcb链接到Fcb1啊,为什么会出现2个Lcb呢?右半部分单独的话可以理解,Scb2是Fcb1和Fcb2的父目录对应的分配属性流,通过Lcb将其子目录(/文件)联系起来.但是整个上半部分一起看的话又产生疑惑了,怎么一个文件(/目录)Fcb1会有2个不同的父目录?
我原来理解是硬链接(交接?外壳链接?),查了相关资料确实有DLT(分布式链接跟踪),可是资料也只是寥寥数语带过,没深入,结果还是云里雾里,用硬链接解释Scb1到Fcb1也解释不通,怎么会有2个Lcb呢,应该只有一个就够了啊.
另外还有以下疑问:
0.An Fcb can have multiple Scb parents (via Lcbs) and multiple Scb Children. ( can have multiple Scb parents??不懂,还请指点)
1.SCB里面怎么没有一个指向LCB的指针(或队列)?倒是FCB里面有一个LcbQueue.
2.VCB 里面已经有了一个SCB *RootIndexScb 为什么还要有一个LCB *RootLcb ,这个LCB在这里起到一个什么作用呢?
3.CCB和LCB的关系:CCB里面有2个结构LcbLinks(LIST_ENTRY)和Lcb(PLCB)
4.结构定义里面还有一个_OVERLAY_LCB结构(如下),这个结构和LCB有什么关系和区别?
struct _OVERLAY_LCB {
FILE_REFERENCE OverlayParentDirectory;
LIST_ENTRY CcbQueue;
NAME_LINK ExactCaseLink;
PFILE_NAME FileNameAttr;
QUICK_INDEX QuickIndex;
UCHAR OverlayFileNameLength;
UCHAR OverlayFlags;
WCHAR OverlayFileName[1];
}