mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-31 15:10:23 +08:00
Fix the problem that when dfs_v2 transmits fd, dentry or vnode does not exist (#8089)
This commit is contained in:
parent
19bfdac891
commit
e6eddfa711
@ -407,19 +407,26 @@ static int _ipc_msg_fd_new(void *file)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef RT_USING_DFS_V2
|
||||
d->fops = df->fops;
|
||||
d->mode = df->mode;
|
||||
d->dentry = df->dentry;
|
||||
d->dentry->ref_count ++;
|
||||
#endif
|
||||
|
||||
d->vnode = df->vnode;
|
||||
d->flags = df->flags;
|
||||
d->data = df->data;
|
||||
d->magic = df->magic;
|
||||
|
||||
d->vnode->ref_count ++;
|
||||
#ifdef RT_USING_DFS_V2
|
||||
d->fops = df->fops;
|
||||
d->mode = df->mode;
|
||||
d->dentry = df->dentry;
|
||||
if (d->dentry)
|
||||
rt_atomic_add(&(d->dentry->ref_count), 1);
|
||||
|
||||
if (d->vnode)
|
||||
rt_atomic_add(&(d->vnode->ref_count), 1);
|
||||
#else
|
||||
if (d->vnode)
|
||||
d->vnode->ref_count ++;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user