]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify inotify_dispatch()
authorVolker Lendecke <vl@samba.org>
Tue, 27 May 2025 15:12:05 +0000 (17:12 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 2 Jun 2025 17:08:34 +0000 (17:08 +0000)
inotify_dispatch() does not need the additional arguments anymore

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/notify_inotify.c

index a8eadf4efbf4a0e7fb76f7e826aea6b3c57b8c7f..d19b4a4cb653a618422648c6e24788da795f525d 100644 (file)
@@ -317,10 +317,7 @@ static bool handle_local_rename(struct inotify_watch_context *w,
 */
 static void inotify_dispatch(struct tevent_context *ev,
                             struct inotify_private *in,
-                            struct inotify_event *e,
-                            int prev_wd,
-                            uint32_t prev_cookie,
-                            struct inotify_event *e2)
+                            struct inotify_event *e)
 {
        struct inotify_watch_context *w, *next;
        struct notify_event ne;
@@ -410,8 +407,6 @@ static void inotify_handler(struct tevent_context *ev, struct tevent_fd *fde,
        char buf[sizeof(struct inotify_event) + NAME_MAX + 1];
        int bufsize = 0;
        struct inotify_event *e = NULL;
-       uint32_t prev_cookie=0;
-       int prev_wd = -1;
        ssize_t ret;
 
        ret = sys_read(in->fd, buf, sizeof(buf));
@@ -434,9 +429,7 @@ static void inotify_handler(struct tevent_context *ev, struct tevent_fd *fde,
                if (bufsize >= sizeof(*e)) {
                        e2 = (struct inotify_event *)(e->len + sizeof(*e) + (char *)e);
                }
-               inotify_dispatch(ev, in, e, prev_wd, prev_cookie, e2);
-               prev_wd = e->wd;
-               prev_cookie = e->cookie;
+               inotify_dispatch(ev, in, e);
                e = e2;
        }
 }