Added a basic unpublishing function for drivers, not yet tested, though (and even
though it looks so simple, I see no reason why it shouldn't work 8-)). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16906 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2828c4d1d7
commit
065aa7f66c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
@ -24,6 +24,7 @@ status_t devfs_publish_file_device(const char *path, const char *filePath);
|
||||
status_t devfs_unpublish_partition(const char *path);
|
||||
status_t devfs_publish_partition(const char *path, const partition_info *info);
|
||||
|
||||
status_t devfs_unpublish_device(const char *path);
|
||||
status_t devfs_publish_device(const char *path, void *ident, device_hooks *calls);
|
||||
status_t devfs_publish_directory(const char *path);
|
||||
|
||||
|
@ -387,7 +387,7 @@ devfs_delete_vnode(struct devfs *fs, struct devfs_vnode *vnode, bool force_delet
|
||||
if (!force_delete
|
||||
&& ((S_ISDIR(vnode->stream.type) && vnode->stream.u.dir.dir_head != NULL)
|
||||
|| vnode->dir_next != NULL))
|
||||
return EPERM;
|
||||
return B_NOT_ALLOWED;
|
||||
|
||||
// remove it from the global hash table
|
||||
hash_remove(fs->vnode_hash, vnode);
|
||||
@ -396,6 +396,8 @@ devfs_delete_vnode(struct devfs *fs, struct devfs_vnode *vnode, bool force_delet
|
||||
// for partitions, we have to release the raw device
|
||||
if (vnode->stream.u.dev.partition)
|
||||
put_vnode(fs->id, vnode->stream.u.dev.partition->raw_device->id);
|
||||
else
|
||||
delete vnode->stream.u.dev.scheduler;
|
||||
|
||||
// remove API conversion from old to new drivers
|
||||
if (vnode->stream.u.dev.node == NULL)
|
||||
@ -2114,6 +2116,14 @@ devfs_publish_partition(const char *path, const partition_info *info)
|
||||
}
|
||||
|
||||
|
||||
extern "C" status_t
|
||||
devfs_unpublish_device(const char *path)
|
||||
{
|
||||
// TODO: disconnect any open file handles!
|
||||
return unpublish_node(sDeviceFileSystem, path, S_IFCHR);
|
||||
}
|
||||
|
||||
|
||||
extern "C" status_t
|
||||
devfs_publish_device(const char *path, void *obsolete, device_hooks *ops)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user