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: (iso9660) rock ridge extension
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
fs
/
twifs.h
diff --git
a/lunaix-os/includes/lunaix/fs/twifs.h
b/lunaix-os/includes/lunaix/fs/twifs.h
index 31875ef24fab16856de08bd40bf250ae22d709f8..a8117ef7cddb61ff4c67b59598c45365ef128691 100644
(file)
--- a/
lunaix-os/includes/lunaix/fs/twifs.h
+++ b/
lunaix-os/includes/lunaix/fs/twifs.h
@@
-2,31
+2,54
@@
#define __LUNAIX_TWIFS_H
#include <lunaix/fs.h>
#define __LUNAIX_TWIFS_H
#include <lunaix/fs.h>
+#include <lunaix/fs/twimap.h>
+#include <lunaix/spike.h>
struct twifs_node
{
struct twifs_node
{
- struct v_inode* inode;
struct hstr name;
struct hstr name;
+ inode_t ino_id;
void* data;
uint32_t itype;
void* data;
uint32_t itype;
+ char name_val[VFS_NAME_MAXLEN];
struct llist_header children;
struct llist_header siblings;
struct llist_header children;
struct llist_header siblings;
- struct v_file_ops fops;
+ struct
+ {
+ int (*write)(struct v_inode* inode,
+ void* buffer,
+ size_t len,
+ size_t fpos);
+ int (*read)(struct v_inode* inode,
+ void* buffer,
+ size_t len,
+ size_t fpos);
+ } ops;
};
};
+#define twinode_getdata(inode, type) \
+ ({ \
+ struct twifs_node* twinode = (struct twifs_node*)(inode)->data; \
+ assert(twinode); \
+ (type) twinode->data; \
+ })
+
void
twifs_init();
struct twifs_node*
void
twifs_init();
struct twifs_node*
-twifs_file_node
(struct twifs_node* parent, const char* name, int name_len
);
+twifs_file_node
_vargs(struct twifs_node* parent, const char* fmt, va_list args
);
struct twifs_node*
struct twifs_node*
-twifs_
dir_node(struct twifs_node* parent, const char* name, int name_len
);
+twifs_
file_node(struct twifs_node* parent, const char* fmt, ...
);
struct twifs_node*
struct twifs_node*
-twifs_
toplevel_node(const char* name, int name_len
);
+twifs_
dir_node(struct twifs_node* parent, const char* fmt, ...
);
int
twifs_rm_node(struct twifs_node* node);
int
twifs_rm_node(struct twifs_node* node);
+struct twimap*
+twifs_mapping(struct twifs_node* parent, void* data, const char* fmt, ...);
+
#endif /* __LUNAIX_TWIFS_H */
#endif /* __LUNAIX_TWIFS_H */