C.5. Glock Holder
表 C.5 “Glock holder 标签” 演示了不同 glock holder 标签的含义。
标签 | 名称 | 含义 |
---|---|---|
a | Async | 不等待 glock 结果(稍后会得到结果) |
A | Any | 接受所有兼容锁模式 |
c | 没有缓存 | 取消锁定时立即降级 DLM 锁定 |
e | 没有过期日期 | 忽略随后的取消锁定请求 |
E | 准确 | 必须有 exact 锁定模式 |
F | 第一 | 设定赋予这个锁定的第一个拥有者 |
H | 拥有者 | 表示赋予请求的锁定 |
p | 优先权 | 在队列头入队的拥有者 |
t | Try | A "try" lock |
T | Try 1CB | A "try" lock that sends a callback |
W | Wait | 等待请求完成的设置 |
最重要的拥有者标签之前提到的是 H(拥有者)和 W(等待),因为是将它们分别设定在已分配锁定请求和已排队锁定请求中。该列表中拥有者的顺序分厂重要。如果有任何已分配拥有者,他们总是位于队列的前端,后面跟着的是已排队拥有者。
如果没有任何已分配拥有者,那么该列表中的第一个拥有者将触发下一个状态更改。因为降级请求总是比该文件系统中的请求有更高的优先权,但那并不一定会有状态请求更改。
The glock subsystem supports two kinds of "try" lock. These are useful both because they allow the taking of locks out of the normal order (with suitable back-off and retry) and because they can be used to help avoid resources in use by other nodes. The normal t (try) lock is basically just what its name indicates; it is a "try" lock that does not do anything special. The T (
try 1CB
) lock, on the other hand, is identical to the t lock except that the DLM will send a single callback to current incompatible lock holders. One use of the T (try 1CB
) lock is with the iopen
locks, which are used to arbitrate among the nodes when an inode's i_nlink
count is zero, and determine which of the nodes will be responsible for deallocating the inode. The iopen
glock is normally held in the shared state, but when the i_nlink
count becomes zero and ->delete_inode
() is called, it will request an exclusive lock with T (try 1CB
) set. It will continue to deallocate the inode if the lock is granted. If the lock is not granted it will result in the node(s) which were preventing the grant of the lock marking their glock(s) with the D (demote) flag, which is checked at ->drop_inode
() time in order to ensure that the deallocation is not forgotten.
This means that inodes that have zero link count but are still open will be deallocated by the node on which the final
close
() occurs. Also, at the same time as the inode's link count is decremented to zero the inode is marked as being in the special state of having zero link count but still in use in the resource group bitmap. This functions like the ext3 file system3's orphan list in that it allows any subsequent reader of the bitmap to know that there is potentially space that might be reclaimed, and to attempt to reclaim it.