summaryrefslogtreecommitdiff
path: root/gio/inotify/inotify-kernel.h
diff options
context:
space:
mode:
authorCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2011-01-19 19:08:15 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-12-05 18:27:34 +0000
commitfd1e9938b36677587dfe9960dacb678bbd3981bf (patch)
treec8cbab0a8235cac8dcd43991701a626bf96c3c96 /gio/inotify/inotify-kernel.h
parent83d0c8a7396e8c1f70619e01f0b0c06fd22790b7 (diff)
downloadglib-fd1e9938b36677587dfe9960dacb678bbd3981bf.tar.gz
Send CHANGES_DONE_HINT on file moves if no IN_CLOSE_WRITE is emitted
This patch makes GFileMonitor to emit EVENT_CHANGES_DONE_HINT when EVENT_CREATED is emitted but the file is not opened for writing. On file moves across different mounted volumes, inotify will always emit IN_CREATE and IN_CLOSE_WRITE (plus other events). This translates into GIO's _EVENT_CREATED and _EVENT_CHANGES_DONE_HINT. On file moves across the same mounted volumes, inotify will emit IN_MOVED_FROM/IN_MOVED_TO which will be translated into _EVENT_DELETED/_EVENT_CREATED GIO's side. No _EVENT_CHANGES_DONE_HINT is emited afterwards. Under such circumstances a file indexer does not know when actually the file is ready to be indexed, either waiting too much or triggering the indexing twice. On small devices it's not advisable. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=640077 Bug-NB: NB#219982 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Tomas Bzatek <tbzatek@redhat.com>
Diffstat (limited to 'gio/inotify/inotify-kernel.h')
-rw-r--r--gio/inotify/inotify-kernel.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gio/inotify/inotify-kernel.h b/gio/inotify/inotify-kernel.h
index b406d71d5..104a189e6 100644
--- a/gio/inotify/inotify-kernel.h
+++ b/gio/inotify/inotify-kernel.h
@@ -26,9 +26,17 @@
typedef struct ik_event_s {
gint32 wd;
guint32 mask;
+ guint32 original_mask;
guint32 cookie;
guint32 len;
char * name;
+ /* TRUE if this event is the last element of a pair
+ * (e.g., MOVE_TO in a pair of MOVE_FROM, MOVE_TO events) */
+ gboolean is_second_in_pair;
+ /* if event1 and event2 are two paired events
+ * (e.g., MOVE_FROM and MOVE_TO events related to the same file move),
+ * then event1->pair == event2 and event2->pair == NULL.
+ * It will result also in event1->pair->is_second_in_pair == TRUE */
struct ik_event_s *pair;
} ik_event_t;