-/****************************************************************************
- 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, NTSTATUS status)
-{
- struct change_notify *cnbp, *next;
-
- for (cnbp=change_notify_list; cnbp; cnbp=next) {
- next=cnbp->next;
- /*
- * We know it refers to the same directory if the connection number and
- * the filename are identical.
- */
- if((cnbp->fsp->conn == fsp->conn) && strequal(cnbp->fsp->fsp_name,fsp->fsp_name)) {
- change_notify_reply_packet(cnbp->request_buf, status);
- change_notify_remove(cnbp);
- }
- }
-}
-
-/****************************************************************************
- Set the current change notify timeout to the lowest value across all service
- values.
-****************************************************************************/
-
-void set_change_notify_timeout(int val)
-{
- if (val > 0) {
- cnotify->select_time = MIN(cnotify->select_time, val);
- }
-}
-
-/****************************************************************************
- Longest time to sleep for before doing a change notify scan.
-****************************************************************************/
-
-int change_notify_timeout(void)
-{
- return cnotify->select_time;
-}
-
-/****************************************************************************
- Process the change notify queue. Note that this is only called as root.
- 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;
- uint16 vuid;
-
- for (cnbp=change_notify_list; cnbp; cnbp=next) {
- next=cnbp->next;
-
- vuid = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID : SVAL(cnbp->request_buf,smb_uid);
-
- if (cnbp->fsp->notify->num_changes != 0) {
- DEBUG(10,("process_pending_change_notify_queue: %s "
- "has %d changes!\n", cnbp->fsp->fsp_name,
- cnbp->fsp->notify->num_changes));
- change_notify_reply(cnbp->request_buf,
- cnbp->max_param_count,
- cnbp->fsp->notify->num_changes,
- cnbp->fsp->notify->changes);
- change_notify_remove(cnbp);
- continue;
- }
-
- if (cnotify->check_notify(cnbp->fsp->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(cnbp->request_buf,
- cnbp->max_param_count,
- cnbp->fsp->notify->num_changes,
- cnbp->fsp->notify->changes);
- change_notify_remove(cnbp);
- }
- }
-
- return (change_notify_list != NULL);
-}
-
-/****************************************************************************
- 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, uint32 max_param_count)