fs: fix fifo

This commit is contained in:
Matheus
2024-09-01 22:52:31 -03:00
parent 5793dda4d9
commit d42572b041
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -1064,7 +1064,6 @@ static int ext2_open(vnode_t **vnodep, int flags, cred_t *cred) {
int error = 0;
if (type == V_TYPE_FIFO) {
VOP_LOCK(*vnodep);
vnode_t *fifo;
error = pipefs_getbinding(*vnodep, &fifo);
VOP_UNLOCK(*vnodep);
@@ -1074,9 +1073,12 @@ static int ext2_open(vnode_t **vnodep, int flags, cred_t *cred) {
VOP_LOCK(fifo);
error = VOP_OPEN(&fifo, flags, cred);
VOP_UNLOCK(fifo);
VOP_LOCK(*vnodep);
if (error == 0)
if (error == 0) {
VOP_HOLD(fifo);
*vnodep = fifo;
}
}
return error;
+2
View File
@@ -183,8 +183,10 @@ static int tmpfs_open(vnode_t **nodep, int flags, cred_t *cred) {
return error;
VOP_LOCK(fifo);
VOP_UNLOCK(node);
error = VOP_OPEN(&fifo, flags, cred);
VOP_UNLOCK(fifo);
VOP_LOCK(node);
if (error == 0) {
*nodep = fifo;
VOP_HOLD(fifo);