Changeset 11884
- Timestamp:
- 03/17/05 16:04:25 (4 years ago)
- Location:
- haiku/trunk
- Files:
-
- 7 modified
-
headers/os/drivers/fs_interface.h (modified) (2 diffs)
-
src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp (modified) (1 diff)
-
src/kernel/core/fs/bootfs.c (modified) (1 diff)
-
src/kernel/core/fs/devfs.cpp (modified) (2 diffs)
-
src/kernel/core/fs/pipefs.cpp (modified) (2 diffs)
-
src/kernel/core/fs/rootfs.c (modified) (1 diff)
-
src/kernel/core/fs/vfs.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
haiku/trunk/headers/os/drivers/fs_interface.h
r11718 r11884 18 18 struct stat; 19 19 struct fs_info; 20 struct select_sync; 20 21 21 22 typedef dev_t mount_id; … … 84 85 status_t (*ioctl)(fs_volume fs, fs_vnode v, fs_cookie cookie, ulong op, void *buffer, size_t length); 85 86 status_t (*set_flags)(fs_volume fs, fs_vnode v, fs_cookie cookie, int flags); 87 status_t (*select)(fs_volume fs, fs_vnode v, fs_cookie cookie, uint8 event, 88 uint32 ref, selectsync *sync); 89 status_t (*deselect)(fs_volume fs, fs_vnode v, fs_cookie cookie, 90 uint8 event, selectsync *sync); 86 91 status_t (*fsync)(fs_volume fs, fs_vnode v); 87 92 -
haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
r11722 r11884 2028 2028 &bfs_ioctl, 2029 2029 &bfs_set_flags, 2030 NULL, // &bfs_select 2031 NULL, // &bfs_deselect 2030 2032 &bfs_fsync, 2031 2033 -
haiku/trunk/src/kernel/core/fs/bootfs.c
r11753 r11884 980 980 &bootfs_ioctl, 981 981 NULL, // set_flags 982 NULL, // select 983 NULL, // deselect 982 984 &bootfs_fsync, 983 985 -
haiku/trunk/src/kernel/core/fs/devfs.cpp
r11015 r11884 1365 1365 1366 1366 1367 static status_t 1368 devfs_select(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, uint8 event, 1369 uint32 ref, selectsync *sync) 1370 { 1371 struct devfs_vnode *vnode = (struct devfs_vnode *)_vnode; 1372 struct devfs_cookie *cookie = (struct devfs_cookie *)_cookie; 1373 1374 if (!S_ISCHR(vnode->stream.type)) 1375 return B_NOT_ALLOWED; 1376 1377 // If the device has no select() hook, notify select() now. 1378 if (!vnode->stream.u.dev.info->select) 1379 return notify_select_event((selectsync*)sync, ref, event); 1380 1381 return vnode->stream.u.dev.info->select(cookie->u.dev.dcookie, event, ref, 1382 (selectsync*)sync); 1383 } 1384 1385 1386 static status_t 1387 devfs_deselect(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, uint8 event, 1388 selectsync *sync) 1389 { 1390 struct devfs_vnode *vnode = (struct devfs_vnode *)_vnode; 1391 struct devfs_cookie *cookie = (struct devfs_cookie *)_cookie; 1392 1393 if (!S_ISCHR(vnode->stream.type)) 1394 return B_NOT_ALLOWED; 1395 1396 // If the device has no select() hook, notify select() now. 1397 if (!vnode->stream.u.dev.info->deselect) 1398 return B_OK; 1399 1400 return vnode->stream.u.dev.info->deselect(cookie->u.dev.dcookie, event, 1401 (selectsync*)sync); 1402 } 1403 1404 1367 1405 static bool 1368 1406 devfs_can_page(fs_volume _fs, fs_vnode _vnode, fs_cookie cookie) … … 1546 1584 &devfs_ioctl, 1547 1585 &devfs_set_flags, 1586 &devfs_select, 1587 &devfs_deselect, 1548 1588 &devfs_fsync, 1549 1589 -
haiku/trunk/src/kernel/core/fs/pipefs.cpp
r11719 r11884 1440 1440 1441 1441 1442 static status_t 1443 pipefs_select(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, uint8 event, 1444 uint32 ref, selectsync *sync) 1445 { 1446 // ToDo: Implement! 1447 return notify_select_event(sync, ref, event); 1448 } 1449 1450 1451 static status_t 1452 pipefs_deselect(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, uint8 event, 1453 selectsync *sync) 1454 { 1455 // ToDo: Implement! 1456 return B_OK; 1457 } 1458 1459 1442 1460 static bool 1443 1461 pipefs_can_page(fs_volume _volume, fs_vnode _v, fs_cookie cookie) … … 1588 1606 &pipefs_ioctl, 1589 1607 &pipefs_set_flags, 1608 &pipefs_select, 1609 &pipefs_deselect, 1590 1610 &pipefs_fsync, 1591 1611 -
haiku/trunk/src/kernel/core/fs/rootfs.c
r11753 r11884 1057 1057 &rootfs_ioctl, 1058 1058 NULL, // fs_set_flags() 1059 NULL, // select 1060 NULL, // deselect 1059 1061 &rootfs_fsync, 1060 1062 -
haiku/trunk/src/kernel/core/fs/vfs.cpp
r11868 r11884 188 188 static void file_free_fd(struct file_descriptor *); 189 189 static status_t file_close(struct file_descriptor *); 190 static status_t file_select(struct file_descriptor *, uint8 event, uint32 ref, 191 struct select_sync *sync); 192 static status_t file_deselect(struct file_descriptor *, uint8 event, 193 struct select_sync *sync); 190 194 static status_t dir_read(struct file_descriptor *, struct dirent *buffer, size_t bufferSize, uint32 *_count); 191 195 static status_t dir_read(struct vnode *vnode, fs_cookie cookie, struct dirent *buffer, size_t bufferSize, uint32 *_count); … … 231 235 file_seek, 232 236 common_ioctl, 233 NULL, // select()234 NULL, // deselect()237 file_select, 238 file_deselect, 235 239 NULL, // read_dir() 236 240 NULL, // rewind_dir() … … 3150 3154 3151 3155 static status_t 3156 file_select(struct file_descriptor *descriptor, uint8 event, uint32 ref, 3157 struct select_sync *sync) 3158 { 3159 FUNCTION(("file_select(%p, %u, %lu, %p)\n", descriptor, event, ref, sync)); 3160 3161 struct vnode *vnode = descriptor->u.vnode; 3162 3163 // If the FS has no select() hook, notify select() now. 3164 if (FS_CALL(vnode, select) == NULL) 3165 return notify_select_event((selectsync*)sync, ref, event); 3166 3167 return FS_CALL(vnode, select)(vnode->mount->cookie, vnode->private_node, 3168 descriptor->cookie, event, ref, (selectsync*)sync); 3169 } 3170 3171 3172 static status_t 3173 file_deselect(struct file_descriptor *descriptor, uint8 event, 3174 struct select_sync *sync) 3175 { 3176 struct vnode *vnode = descriptor->u.vnode; 3177 3178 if (FS_CALL(vnode, deselect) == NULL) 3179 return B_OK; 3180 3181 return FS_CALL(vnode, deselect)(vnode->mount->cookie, vnode->private_node, 3182 descriptor->cookie, event, (selectsync*)sync); 3183 } 3184 3185 3186 static status_t 3152 3187 dir_create_entry_ref(mount_id mountID, vnode_id parentID, const char *name, int perms, bool kernel) 3153 3188 {
