As suggested by Ingo use a B_WATCH_VOLUME flag to tell the kernel to watch
the whole volume. Kernel part follows. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39106 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
32c2214392
commit
bfff9df5eb
@ -83,9 +83,8 @@ class BLooper;
|
||||
class BHandler;
|
||||
|
||||
|
||||
extern status_t watch_volume(const dev_t volume, uint32 flags,
|
||||
BMessenger target);
|
||||
extern status_t watch_volume(const dev_t volume, uint32 flags,
|
||||
extern status_t watch_volume(dev_t volume, uint32 flags, BMessenger target);
|
||||
extern status_t watch_volume(dev_t volume, uint32 flags,
|
||||
const BHandler *handler, const BLooper *looper = NULL);
|
||||
|
||||
extern status_t watch_node(const node_ref *node, uint32 flags,
|
||||
|
14
headers/private/system/node_monitor_private.h
Normal file
14
headers/private/system/node_monitor_private.h
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright 2010, Clemens Zeidler, haiku@clemens-zeidler.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _NODE_MONITOR_PRIVATE_H
|
||||
#define _NODE_MONITOR_PRIVATE_H
|
||||
|
||||
|
||||
enum {
|
||||
B_WATCH_VOLUME = 0xF000
|
||||
};
|
||||
|
||||
|
||||
#endif /* _NODE_MONITOR_PRIVATE_H */
|
@ -15,10 +15,13 @@
|
||||
|
||||
#include <syscalls.h>
|
||||
|
||||
#include "node_monitor_private.h"
|
||||
|
||||
|
||||
// TODO: Tests!
|
||||
|
||||
|
||||
// watch_node
|
||||
// watch_volume
|
||||
/*! \brief Subscribes a target to watch node changes on a volume.
|
||||
|
||||
Depending of \a flags the action performed by this function varies:
|
||||
@ -32,12 +35,14 @@
|
||||
\return \c B_OK, if everything went fine, another error code otherwise.
|
||||
*/
|
||||
status_t
|
||||
watch_volume(const dev_t volume, uint32 flags, BMessenger target)
|
||||
watch_volume(dev_t volume, uint32 flags, BMessenger target)
|
||||
{
|
||||
if ((flags | B_WATCH_NAME) == 0 && (flags | B_WATCH_STAT)
|
||||
&& (flags | B_WATCH_ATTR))
|
||||
return B_BAD_VALUE;
|
||||
|
||||
flags |= B_WATCH_VOLUME;
|
||||
|
||||
BMessenger::Private messengerPrivate(target);
|
||||
port_id port = messengerPrivate.Port();
|
||||
int32 token = messengerPrivate.Token();
|
||||
@ -46,7 +51,7 @@ watch_volume(const dev_t volume, uint32 flags, BMessenger target)
|
||||
|
||||
|
||||
status_t
|
||||
watch_volume(const dev_t volume, uint32 flags, const BHandler *handler,
|
||||
watch_volume(dev_t volume, uint32 flags, const BHandler *handler,
|
||||
const BLooper *looper)
|
||||
{
|
||||
return watch_volume(volume, flags, BMessenger(handler, looper));
|
||||
|
Loading…
Reference in New Issue
Block a user