git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: owloysius - dynamic init function invocator
[lunaix-os.git]
/
lunaix-os
/
kernel
/
fs
/
vfs.c
diff --git
a/lunaix-os/kernel/fs/vfs.c
b/lunaix-os/kernel/fs/vfs.c
index 490b4dfd285cc05a7c7791427a60984f3ebc2204..80d2036b88ab8657e48fa45ab96ab566d3b7f256 100644
(file)
--- a/
lunaix-os/kernel/fs/vfs.c
+++ b/
lunaix-os/kernel/fs/vfs.c
@@
-1235,14
+1235,19
@@
void
vfs_ref_dnode(struct v_dnode* dnode)
{
atomic_fetch_add(&dnode->ref_count, 1);
vfs_ref_dnode(struct v_dnode* dnode)
{
atomic_fetch_add(&dnode->ref_count, 1);
- mnt_mkbusy(dnode->mnt);
+
+ if (dnode->mnt) {
+ mnt_mkbusy(dnode->mnt);
+ }
}
void
vfs_unref_dnode(struct v_dnode* dnode)
{
atomic_fetch_sub(&dnode->ref_count, 1);
}
void
vfs_unref_dnode(struct v_dnode* dnode)
{
atomic_fetch_sub(&dnode->ref_count, 1);
- mnt_chillax(dnode->mnt);
+ if (dnode->mnt) {
+ mnt_chillax(dnode->mnt);
+ }
}
int
}
int
@@
-1448,7
+1453,7
@@
__DEFINE_LXSYSCALL2(int, fstat, int, fd, struct file_stat*, stat)
.st_blksize = vino->sb->blksize};
if (VFS_DEVFILE(vino->itype)) {
.st_blksize = vino->sb->blksize};
if (VFS_DEVFILE(vino->itype)) {
- struct device* rdev =
(struct device*)vino->data
;
+ struct device* rdev =
resolve_device(vino->data)
;
if (!rdev || rdev->magic != DEV_STRUCT_MAGIC) {
errno = EINVAL;
goto done;
if (!rdev || rdev->magic != DEV_STRUCT_MAGIC) {
errno = EINVAL;
goto done;