From 4bb9cebf84e1addc135c18b1227e7c00e7c03163 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Oct 2001 08:37:32 +0000 Subject: Tidy up debug in notify code. Jeremy. (This used to be commit 7707c5e07385ce5ac3732715d586ad6c6b41de65) --- source3/smbd/notify.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'source3/smbd/notify.c') diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 999821354e..d333e0f75a 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -28,7 +28,7 @@ static struct cnotify_fns *cnotify; This is the structure to queue to implement NT change notify. It consists of smb_size bytes stored from the transact command (to keep the mid, tid etc around). - Plus the fid to examine and notify private data + Plus the fid to examine and notify private data. *****************************************************************************/ struct change_notify { @@ -65,10 +65,10 @@ static void change_notify_reply_packet(char *inbuf, NTSTATUS error_code) } /**************************************************************************** -remove an entry from the list and free it, also closing any -directory handle if necessary -Notice the horrible stuff we have to do because this is a singly linked list. + Remove an entry from the list and free it, also closing any + directory handle if necessary. *****************************************************************************/ + static void change_notify_remove(struct change_notify *cnbp) { cnotify->remove_notify(cnbp->change_data); @@ -77,10 +77,10 @@ static void change_notify_remove(struct change_notify *cnbp) SAFE_FREE(cnbp); } - /**************************************************************************** Delete entries by fnum from the change notify pending queue. *****************************************************************************/ + void remove_pending_change_notify_requests_by_fid(files_struct *fsp) { struct change_notify *cnbp, *next; @@ -96,6 +96,7 @@ void remove_pending_change_notify_requests_by_fid(files_struct *fsp) /**************************************************************************** Delete entries by mid from the change notify pending queue. Always send reply. *****************************************************************************/ + void remove_pending_change_notify_requests_by_mid(int mid) { struct change_notify *cnbp, *next; @@ -113,6 +114,7 @@ void remove_pending_change_notify_requests_by_mid(int mid) Delete entries by filename and cnum from the change notify pending queue. Always send reply. *****************************************************************************/ + void remove_pending_change_notify_requests_by_filename(files_struct *fsp) { struct change_notify *cnbp, *next; @@ -133,6 +135,7 @@ void remove_pending_change_notify_requests_by_filename(files_struct *fsp) /**************************************************************************** Return true if there are pending change notifies. ****************************************************************************/ + int change_notify_timeout(void) { return cnotify->select_time; @@ -143,6 +146,7 @@ int change_notify_timeout(void) Returns True if there are still outstanding change notify requests on the queue. *****************************************************************************/ + BOOL process_pending_change_notify_queue(time_t t) { struct change_notify *cnbp, *next; @@ -152,8 +156,9 @@ BOOL process_pending_change_notify_queue(time_t t) next=cnbp->next; vuid = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID : SVAL(cnbp->request_buf,smb_uid); - + if (cnotify->check_notify(cnbp->conn, vuid, cnbp->fsp->fsp_name, cnbp->flags, cnbp->change_data, t)) { + DEBUG(10,("process_pending_change_notify_queue: dir %s changed !\n", cnbp->fsp->fsp_name )); change_notify_reply_packet(cnbp->request_buf,STATUS_NOTIFY_ENUM_DIR); change_notify_remove(cnbp); } @@ -163,11 +168,12 @@ BOOL process_pending_change_notify_queue(time_t t) } /**************************************************************************** - * Now queue an entry on the notify change list. - * We only need to save smb_size bytes from this incoming packet - * as we will always by returning a 'read the directory yourself' - * error. + Now queue an entry on the notify change list. + We only need to save smb_size bytes from this incoming packet + as we will always by returning a 'read the directory yourself' + error. ****************************************************************************/ + BOOL change_notify_set(char *inbuf, files_struct *fsp, connection_struct *conn, uint32 flags) { struct change_notify *cnbp; @@ -195,10 +201,10 @@ BOOL change_notify_set(char *inbuf, files_struct *fsp, connection_struct *conn, return True; } - /**************************************************************************** -initialise the change notify subsystem + Initialise the change notify subsystem. ****************************************************************************/ + BOOL init_change_notify(void) { #if HAVE_KERNEL_CHANGE_NOTIFY -- cgit