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
regression: test serial port r/w.
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
fs.h
diff --git
a/lunaix-os/includes/lunaix/fs.h
b/lunaix-os/includes/lunaix/fs.h
index 3ec85f5c2b711fce57f8b273af22694d0c1da571..d90a773294099a40ef39ea90df2314aaabcc2c7d 100644
(file)
--- a/
lunaix-os/includes/lunaix/fs.h
+++ b/
lunaix-os/includes/lunaix/fs.h
@@
-6,10
+6,10
@@
#include <lunaix/ds/btrie.h>
#include <lunaix/ds/hashtable.h>
#include <lunaix/ds/hstr.h>
#include <lunaix/ds/btrie.h>
#include <lunaix/ds/hashtable.h>
#include <lunaix/ds/hstr.h>
+#include <lunaix/ds/ldga.h>
#include <lunaix/ds/llist.h>
#include <lunaix/ds/lru.h>
#include <lunaix/ds/mutex.h>
#include <lunaix/ds/llist.h>
#include <lunaix/ds/lru.h>
#include <lunaix/ds/mutex.h>
-#include <lunaix/process.h>
#include <lunaix/status.h>
#include <stdatomic.h>
#include <lunaix/status.h>
#include <stdatomic.h>
@@
-20,11
+20,21
@@
#define VFS_IFFILE 0x2
#define VFS_IFSEQDEV 0x4
#define VFS_IFVOLDEV 0x8
#define VFS_IFFILE 0x2
#define VFS_IFSEQDEV 0x4
#define VFS_IFVOLDEV 0x8
-#define VFS_IFSYMLINK 0x1
6
+#define VFS_IFSYMLINK 0x1
0
+// Walk, mkdir if component encountered is non-exists.
#define VFS_WALK_MKPARENT 0x1
#define VFS_WALK_MKPARENT 0x1
+
+// Walk, relative to current FS.
#define VFS_WALK_FSRELATIVE 0x2
#define VFS_WALK_FSRELATIVE 0x2
+
+/*
+ Terminate the walk on the immediate parent,
+ name of child (last component) is returned through `component`
+*/
#define VFS_WALK_PARENT 0x4
#define VFS_WALK_PARENT 0x4
+
+// Do not follow the symbolic link
#define VFS_WALK_NOFOLLOW 0x8
#define VFS_HASHTABLE_BITS 10
#define VFS_WALK_NOFOLLOW 0x8
#define VFS_HASHTABLE_BITS 10
@@
-36,11
+46,11
@@
#define FSTYPE_ROFS 0x1
#define FSTYPE_ROFS 0x1
-#define DO_STATUS(errno) SYSCALL_ESTATUS(__current->k_status = errno)
-#define DO_STATUS_OR_RETURN(errno) ({ errno < 0 ? DO_STATUS(errno) : errno; })
-
#define TEST_FD(fd) (fd >= 0 && fd < VFS_MAX_FD)
#define TEST_FD(fd) (fd >= 0 && fd < VFS_MAX_FD)
+#define EXPORT_FILE_SYSTEM(fs_id, init_fn) \
+ export_ldga_el(fs, fs_id, ptr_t, init_fn)
+
#define VFS_VALID_CHAR(chr) \
(('A' <= (chr) && (chr) <= 'Z') || ('a' <= (chr) && (chr) <= 'z') || \
('0' <= (chr) && (chr) <= '9') || (chr) == '.' || (chr) == '_' || \
#define VFS_VALID_CHAR(chr) \
(('A' <= (chr) && (chr) <= 'Z') || ('a' <= (chr) && (chr) <= 'z') || \
('0' <= (chr) && (chr) <= '9') || (chr) == '.' || (chr) == '_' || \
@@
-400,6
+410,9
@@
vfs_get_dtype(int itype);
void
vfs_ref_dnode(struct v_dnode* dnode);
void
vfs_ref_dnode(struct v_dnode* dnode);
+void
+vfs_ref_file(struct v_file* file);
+
void
vfs_unref_dnode(struct v_dnode* dnode);
void
vfs_unref_dnode(struct v_dnode* dnode);