diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-12-31 17:52:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:50 -0500 |
commit | 200bd10b32107b4ce8fc72cc2abbf5a247708ba6 (patch) | |
tree | 5c3d7cfef6259d693633218936724acb1b9824ac /source3/include | |
parent | 421ffdbb2439fbf44cb61e0d1549071b85a3507c (diff) | |
download | samba-200bd10b32107b4ce8fc72cc2abbf5a247708ba6.tar.gz samba-200bd10b32107b4ce8fc72cc2abbf5a247708ba6.tar.bz2 samba-200bd10b32107b4ce8fc72cc2abbf5a247708ba6.zip |
r20442: Slight rewrite of the change notify infrastructure. This now survives the
first of the raw-notify subtests, the one-level test_notify_dir without any
flags around yet.
The tricky part was getting the data structures right, I hope the next tests
don't let that fall over.
fsp->notify is now by default NULL, meaning that nobody has issued a
changenotify call. This means nobody is interested in changes for this
directory.
If that has happened, notify_change_buf collects the changes if no current
request is outstanding, and it collects the requests if no change has happened
since the last request.
Happy New Year, somewhere on this planet it's already 2007 :-)
Volker
P.S: Jeremy, there's a question for you in smbd/files.c line 367.
(This used to be commit ce0ad24988075465addcac0b9afc872e909135af)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/smb.h | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h index c4d4660028..5f69ac23fa 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -428,14 +428,46 @@ struct vfs_fsp_data { */ }; +/* the basic packet size, assuming no words or bytes */ +#define smb_size 39 + struct notify_change { uint32_t action; char *name; }; -struct notify_changes { - uint32_t num_changes; +struct notify_change_request { + struct notify_change_request *prev, *next; + struct files_struct *fsp; /* backpointer for cancel by mid */ + char request_buf[smb_size]; + uint32 max_param_count; + struct notify_mid_map *mid_map; +}; + +/* + * For NTCancel, we need to find the notify_change_request indexed by + * mid. Separate list here. + */ + +struct notify_mid_map { + struct notify_mid_map *prev, *next; + struct notify_change_request *req; + uint16 mid; +}; + +struct notify_change_buf { + /* + * If no requests are pending, changes are queued here. Simple array, + * we only append. + */ + unsigned num_changes; struct notify_change *changes; + + /* + * If no changes are around requests are queued here. Using a linked + * list, because we have to append at the end and delete from the top. + */ + struct notify_change_request *requests; }; typedef struct files_struct { @@ -481,7 +513,7 @@ typedef struct files_struct { struct vfs_fsp_data *vfs_extension; FAKE_FILE_HANDLE *fake_file_handle; - struct notify_changes *notify; + struct notify_change_buf *notify; } files_struct; #include "ntquotas.h" @@ -891,9 +923,6 @@ struct bitmap { unsigned int n; }; -/* the basic packet size, assuming no words or bytes */ -#define smb_size 39 - /* offsets into message for common items */ #define smb_com 8 #define smb_rcls 9 |