ncloader  0.1
 모두 데이타 구조 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 매크로 그룹들 페이지들
vfs.h
이 파일의 문서화 페이지로 가기
1 
19 enum ntype {
22 };
23 
25 struct ninfo {
26  char *name;
27  enum ntype type;
28  int refcnt;
29  int deleted;
31 
32  struct sinfo *si;
33  void *priv;
35  unsigned long size;
38  struct list_head sibling;
40  struct list_head child;
41  struct list_head sinfo;
43  int (*read)(struct ninfo *, off_t, void *, size_t);
44  int (*write)(struct ninfo *, off_t, const void *, size_t);
45 };
46 
47 #define ROOT_NINFO 0
48 
49 struct sinfo {
50  struct list_head head;
51  void *priv;
52  int refcnt;
53 
54  struct ninfo *(*get_ninfo)(struct sinfo *this, unsigned long id);
55  int (*put_ninfo)(struct sinfo *this, struct ninfo *ninfo);
56  int (*del_ninfo)(struct sinfo *this, struct ninfo *ninfo);
57  void (*refresh_children)(struct sinfo *this, struct ninfo *ninfo);
58 };
59 
60 static inline void vfs_ninfo_ref(struct ninfo *node)
61 {
62  node->refcnt++;
63 }
64 
65 static inline void vfs_ninfo_unref(struct ninfo *node)
66 {
67  node->refcnt--;
68 }
69 
70 static inline void vfs_sinfo_ref(struct sinfo *sinfo)
71 {
72  sinfo->refcnt++;
73 }
74 
75 static inline void vfs_sinfo_unref(struct sinfo *sinfo)
76 {
77  sinfo->refcnt--;
78 }
79 
85 extern struct ninfo *vfs_get_ninfo_child(struct ninfo *node);
86 
92 extern struct ninfo *vfs_get_ninfo_parent(struct ninfo *node);
93 
100 extern struct ninfo *vfs_get_ninfo_next_sibling(struct ninfo *node);
101 
108 extern struct ninfo *vfs_get_ninfo_prev_sibling(struct ninfo *node);
109 
115 extern struct sinfo *vfs_get_last_sinfo(struct ninfo *node);
116 
126 extern ssize_t vfs_read_ninfo(struct ninfo *node,
127  off_t offset, void *buf, size_t size);
128 
138 extern ssize_t vfs_write_ninfo(struct ninfo *node,
139  off_t offset, const void *buf, size_t size);
140 
145 extern int vfs_init(void);
146 
153 extern int vfs_attach_storage(struct ninfo *node, struct sinfo *sb);
154 
160 extern int vfs_deatch_storage(struct ninfo *node);
161 
169 extern struct ninfo *vfs_get_ninfo(struct sinfo *sinfo, struct ninfo *node,
170  const char *path);
171 
177 extern int vfs_del_ninfo(struct ninfo *ninfo);
178