The private data field in struct file_descriptor is now a union (that can
currently hold a pointer to a fs_mount, or a vnode). Updated the index_dir part of the fs API. Added FDTYPE_INDEX_DIR in fd.h. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1188 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -119,11 +119,11 @@ typedef struct fs_ops {
|
|||||||
status_t (*remove_attr)(fs_volume fs, fs_vnode file, const char *name);
|
status_t (*remove_attr)(fs_volume fs, fs_vnode file, const char *name);
|
||||||
|
|
||||||
/* index directory & index operations */
|
/* index directory & index operations */
|
||||||
status_t (*open_index_dir)(fs_volume fs, fs_vnode v, fs_cookie *cookie, int oflags);
|
status_t (*open_index_dir)(fs_volume fs, fs_cookie *cookie);
|
||||||
status_t (*close_index_dir)(fs_volume fs, fs_vnode v, fs_cookie cookie);
|
status_t (*close_index_dir)(fs_volume fs, fs_cookie cookie);
|
||||||
status_t (*free_index_dir_cookie)(fs_volume fs, fs_vnode v, fs_cookie cookie);
|
status_t (*free_index_dir_cookie)(fs_volume fs, fs_cookie cookie);
|
||||||
status_t (*read_index_dir)(fs_volume fs, fs_vnode v, fs_cookie cookie, struct dirent *buffer, size_t bufferSize, uint32 *_num);
|
status_t (*read_index_dir)(fs_volume fs, fs_cookie cookie, struct dirent *buffer, size_t bufferSize, uint32 *_num);
|
||||||
status_t (*rewind_index_dir)(fs_volume fs, fs_vnode v, fs_cookie cookie);
|
status_t (*rewind_index_dir)(fs_volume fs, fs_cookie cookie);
|
||||||
|
|
||||||
status_t (*create_index)(fs_volume fs, const char *name, uint32 type, int flags);
|
status_t (*create_index)(fs_volume fs, const char *name, uint32 type, int flags);
|
||||||
status_t (*remove_index)(fs_volume fs, const char *name);
|
status_t (*remove_index)(fs_volume fs, const char *name);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
struct file_descriptor;
|
struct file_descriptor;
|
||||||
|
struct fs_mount;
|
||||||
struct vnode;
|
struct vnode;
|
||||||
|
|
||||||
/** The I/O context of a process/team, holds the fd array */
|
/** The I/O context of a process/team, holds the fd array */
|
||||||
@@ -43,7 +44,10 @@ struct file_descriptor {
|
|||||||
int32 type; /* descriptor type */
|
int32 type; /* descriptor type */
|
||||||
int32 ref_count;
|
int32 ref_count;
|
||||||
struct fd_ops *ops;
|
struct fd_ops *ops;
|
||||||
struct vnode *vnode;
|
union {
|
||||||
|
struct vnode *vnode;
|
||||||
|
struct fs_mount *mount;
|
||||||
|
} u;
|
||||||
void *cookie;
|
void *cookie;
|
||||||
int32 open_mode;
|
int32 open_mode;
|
||||||
};
|
};
|
||||||
@@ -55,8 +59,9 @@ enum fd_types {
|
|||||||
FDTYPE_FILE = 1,
|
FDTYPE_FILE = 1,
|
||||||
FDTYPE_ATTR,
|
FDTYPE_ATTR,
|
||||||
FDTYPE_DIR,
|
FDTYPE_DIR,
|
||||||
FDTYPE_ATTRDIR,
|
FDTYPE_ATTR_DIR,
|
||||||
FDTYPE_INDEX,
|
FDTYPE_INDEX,
|
||||||
|
FDTYPE_INDEX_DIR,
|
||||||
FDTYPE_QUERY,
|
FDTYPE_QUERY,
|
||||||
FDTYPE_SOCKET
|
FDTYPE_SOCKET
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user