nodefs: introduce FileID, an ID type for persistent
identification This fixes another possible race condition if the same file is looked up through 2 different paths. Remove FindChildByOpaqueID(), since it is still susceptible to race conditions: two lookup calls might be racing, and both may see FindChildByOpaqueID == nil, creating two Node objects Instead, NewInode() automatically discards a new Node if it finds one with existing opaqueID. The FileID struct has (uint64,uint64) for Dev, Ino. While Dev typically is uint32 (the FUSE protocol has uint32), it is uint64 analogous to syscall.Stat_t. The resulting 128 bits of ID space is also ample space for storing hashes of other IDs (eg strings)
Showing
Please register or sign in to comment