NodeMonitor: Added B_WATCH_CHILDREN flag.

* Added a directory argument for notify_{stat/attribute}_changed().
* This allows to watch only a directory, and get the notifications for
  all of its files, not just add/remove entry notifications.
This commit is contained in:
Axel Dörfler
2016-03-28 14:31:27 +02:00
parent 55f28f1396
commit 6f7fc2204b
31 changed files with 367 additions and 307 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2014, Haiku Inc. All Rights Reserved.
* Copyright 2004-2016, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FS_INTERFACE_H
@@ -358,10 +358,10 @@ extern status_t notify_entry_removed(dev_t device, ino_t directory,
extern status_t notify_entry_moved(dev_t device, ino_t fromDirectory,
const char* fromName, ino_t toDirectory,
const char* toName, ino_t node);
extern status_t notify_stat_changed(dev_t device, ino_t node,
extern status_t notify_stat_changed(dev_t device, ino_t directory, ino_t node,
uint32 statFields);
extern status_t notify_attribute_changed(dev_t device, ino_t node,
const char* attribute, int32 cause);
extern status_t notify_attribute_changed(dev_t device, ino_t directory,
ino_t node, const char* attribute, int32 cause);
extern status_t notify_query_entry_created(port_id port, int32 token,
dev_t device, ino_t directory, const char* name,
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2003, Haiku Inc. All Rights Reserved.
* Copyright 2002-2016, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FS_INFO_H
@@ -20,6 +20,7 @@
#define B_FS_HAS_SELF_HEALING_LINKS 0x00080000
#define B_FS_HAS_ALIASES 0x00100000
#define B_FS_SUPPORTS_NODE_MONITORING 0x00200000
#define B_FS_SUPPORTS_MONITOR_CHILDREN 0x00400000
typedef struct fs_info {
dev_t dev; /* volume dev_t */
+3 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2010 Haiku Inc. All rights reserved.
* Copyright 2003-2016 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _NODE_MONITOR_H
@@ -23,7 +23,8 @@ enum {
B_WATCH_ALL = 0x000f,
B_WATCH_MOUNT = 0x0010,
B_WATCH_INTERIM_STAT = 0x0020
B_WATCH_INTERIM_STAT = 0x0020,
B_WATCH_CHILDREN = 0x0040
};
@@ -895,6 +895,7 @@
#define B_FS_HAS_SELF_HEALING_LINKS FSSH_B_FS_HAS_SELF_HEALING_LINKS
#define B_FS_HAS_ALIASES FSSH_B_FS_HAS_ALIASES
#define B_FS_SUPPORTS_NODE_MONITORING FSSH_B_FS_SUPPORTS_NODE_MONITORING
#define B_FS_SUPPORTS_MONITOR_CHILDREN FSSH_B_FS_SUPPORTS_MONITOR_CHILDREN
#define fs_info fssh_fs_info
+1
View File
@@ -21,6 +21,7 @@
#define FSSH_B_FS_HAS_SELF_HEALING_LINKS 0x00080000
#define FSSH_B_FS_HAS_ALIASES 0x00100000
#define FSSH_B_FS_SUPPORTS_NODE_MONITORING 0x00200000
#define FSSH_B_FS_SUPPORTS_MONITOR_CHILDREN 0x00400000
typedef struct fssh_fs_info {
fssh_dev_t dev; /* volume dev_t */
+4 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2008, Haiku Inc. All Rights Reserved.
* Copyright 2004-2016, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FSSH_FS_INTERFACE_H
@@ -395,9 +395,10 @@ extern fssh_status_t fssh_notify_entry_moved(fssh_mount_id device,
fssh_vnode_id toDirectory, const char *toName,
fssh_vnode_id node);
extern fssh_status_t fssh_notify_stat_changed(fssh_mount_id device,
fssh_vnode_id node, uint32_t statFields);
fssh_vnode_id dir, fssh_vnode_id node, uint32_t statFields);
extern fssh_status_t fssh_notify_attribute_changed(fssh_mount_id device,
fssh_vnode_id node, const char *attribute, int32_t cause);
fssh_vnode_id dir, fssh_vnode_id node, const char *attribute,
int32_t cause);
extern fssh_status_t fssh_notify_query_entry_created(fssh_port_id port,
int32_t token, fssh_mount_id device,