- 论坛徽章:
- 0
|
照这段代码的意思,如果我调用__d_find_alias时,inode是一个文件,而且want_discon == 1,那必然会返回NULL,
文件inode里的i_dentry不可能有DISCONNECTED的dentry吗?
- static struct dentry * __d_find_alias(struct inode *inode, int want_discon)
- {
- struct list_head *head, *next, *tmp;
- struct dentry *alias, *discon_alias=NULL;
- head = &inode->i_dentry;
- next = inode->i_dentry.next;
- while (next != head) {
- tmp = next;
- next = tmp->next;
- prefetch(next);
- alias = list_entry(tmp, struct dentry, d_alias);
- if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
- if (IS_ROOT(alias) &&
- (alias->d_flags & DCACHE_DISCONNECTED))
- discon_alias = alias;
- else if (!want_discon) {
- __dget_locked(alias);
- return alias;
- }
- }
- }
- if (discon_alias)
- __dget_locked(discon_alias);
- return discon_alias;
- }
复制代码 |
|