提交 cc5b59ab 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

mtwriteavar() for final inode in namex

上级 1ce14b62
......@@ -775,7 +775,13 @@ namex(inode *cwd, const char *path, int nameiparent, char *name)
if(r == -1 || nameiparent)
return 0;
mtreadavar("inode:%x.%x", ip->dev, ip->inum);
// XXX write is necessary because of idup. not logically required,
// so we should replace this with mtreadavar() eventually, perhaps
// once we implement sloppy counters for long-term inode refs.
// mtreadavar("inode:%x.%x", ip->dev, ip->inum);
mtwriteavar("inode:%x.%x", ip->dev, ip->inum);
idup(ip);
return ip;
}
......
......@@ -296,6 +296,10 @@ sys_openat(int dirfd, const char *path, int omode)
if(omode & O_CREATE){
if((ip = create(cwd, path, T_FILE, 0, 0)) == 0)
return -1;
// XXX necessary because the mtwriteavar() to the same abstract variable
// does not propagate to our scope, since create() has its own inner scope.
mtwriteavar("inode:%x.%x", ip->dev, ip->inum);
} else {
retry:
if((ip = namei(cwd, path)) == 0)
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论