1.1 --- a/libfsclient/include/fsclient/notifier.h Wed Mar 09 18:13:17 2022 +0100
1.2 +++ b/libfsclient/include/fsclient/notifier.h Thu Mar 10 23:23:07 2022 +0100
1.3 @@ -93,8 +93,6 @@
1.4
1.5 virtual bool _transfer(FileNotificationState &state, file_t *file);
1.6
1.7 - virtual void _unsubscribe(FileNotificationState &state, file_t *file);
1.8 -
1.9 public:
1.10 virtual ~FileNotifier();
1.11
2.1 --- a/libfsclient/lib/src/notifier.cc Wed Mar 09 18:13:17 2022 +0100
2.2 +++ b/libfsclient/lib/src/notifier.cc Thu Mar 10 23:23:07 2022 +0100
2.3 @@ -1,7 +1,7 @@
2.4 /*
2.5 * File event notification support.
2.6 *
2.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
2.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
2.9 *
2.10 * This program is free software; you can redistribute it and/or
2.11 * modify it under the terms of the GNU General Public License as
2.12 @@ -221,14 +221,7 @@
2.13 if (state.is_null())
2.14 return -L4_EINVAL;
2.15
2.16 - client_Notification notify(file->ref);
2.17 -
2.18 - long err = notify.unsubscribe(state.endpoint);
2.19 -
2.20 - if (err)
2.21 - return err;
2.22 -
2.23 - _unsubscribe(state, file);
2.24 + _state.erase(file);
2.25
2.26 /* Remove the lock for updating file state. */
2.27
2.28 @@ -237,21 +230,6 @@
2.29 return L4_EOK;
2.30 }
2.31
2.32 -/* Remove file notification state from the notifier. */
2.33 -
2.34 -void FileNotifier::_unsubscribe(FileNotificationState &state, file_t *file)
2.35 -{
2.36 - /* Acquire the lock for updating file state. */
2.37 -
2.38 - std::mutex &file_lock = _file_locks[file];
2.39 - std::unique_lock<std::mutex> file_guard(file_lock);
2.40 -
2.41 - /* Remove file-specific state. */
2.42 -
2.43 - ipc_cap_free_um(state.endpoint);
2.44 - _state.erase(file);
2.45 -}
2.46 -
2.47
2.48
2.49 /* Handle a notification event for a file. Ideally, this would be invoked by the
3.1 --- a/libfsserver/include/fsserver/directory_resource.h Wed Mar 09 18:13:17 2022 +0100
3.2 +++ b/libfsserver/include/fsserver/directory_resource.h Thu Mar 10 23:23:07 2022 +0100
3.3 @@ -64,8 +64,6 @@
3.4 /* Notification methods. */
3.5
3.6 virtual long subscribe(l4_cap_idx_t endpoint, notify_flags_t flags);
3.7 -
3.8 - virtual long unsubscribe(l4_cap_idx_t endpoint);
3.9 };
3.10
3.11 // vim: tabstop=4 expandtab shiftwidth=4
4.1 --- a/libfsserver/include/fsserver/file_pager.h Wed Mar 09 18:13:17 2022 +0100
4.2 +++ b/libfsserver/include/fsserver/file_pager.h Thu Mar 10 23:23:07 2022 +0100
4.3 @@ -75,8 +75,6 @@
4.4 /* Notification methods. */
4.5
4.6 virtual long subscribe(l4_cap_idx_t endpoint, notify_flags_t flags);
4.7 -
4.8 - virtual long unsubscribe(l4_cap_idx_t endpoint);
4.9 };
4.10
4.11 // vim: tabstop=4 expandtab shiftwidth=4
5.1 --- a/libfsserver/include/fsserver/notification.h Wed Mar 09 18:13:17 2022 +0100
5.2 +++ b/libfsserver/include/fsserver/notification.h Thu Mar 10 23:23:07 2022 +0100
5.3 @@ -86,8 +86,6 @@
5.4 virtual unsigned int subscribe(l4_cap_idx_t notifier, notify_flags_t flags);
5.5
5.6 virtual void subscribe(unsigned int endpoint, l4_cap_idx_t notifier, notify_flags_t flags);
5.7 -
5.8 - virtual void unsubscribe(unsigned int endpoint, l4_cap_idx_t notifier);
5.9 };
5.10
5.11 // vim: tabstop=4 expandtab shiftwidth=4
6.1 --- a/libfsserver/include/fsserver/pipe_pager.h Wed Mar 09 18:13:17 2022 +0100
6.2 +++ b/libfsserver/include/fsserver/pipe_pager.h Thu Mar 10 23:23:07 2022 +0100
6.3 @@ -77,8 +77,6 @@
6.4 /* Notification methods. */
6.5
6.6 virtual long subscribe(l4_cap_idx_t notifier, notify_flags_t flags);
6.7 -
6.8 - virtual long unsubscribe(l4_cap_idx_t notifier);
6.9 };
6.10
6.11 // vim: tabstop=4 expandtab shiftwidth=4
7.1 --- a/libfsserver/lib/directories/directory_resource.cc Wed Mar 09 18:13:17 2022 +0100
7.2 +++ b/libfsserver/lib/directories/directory_resource.cc Thu Mar 10 23:23:07 2022 +0100
7.3 @@ -1,7 +1,7 @@
7.4 /*
7.5 * A resource offering support for accessing directories.
7.6 *
7.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
7.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
7.9 *
7.10 * This program is free software; you can redistribute it and/or
7.11 * modify it under the terms of the GNU General Public License as
7.12 @@ -134,10 +134,4 @@
7.13 return L4_EOK;
7.14 }
7.15
7.16 -long DirectoryResource::unsubscribe(l4_cap_idx_t endpoint)
7.17 -{
7.18 - _provider->unsubscribe(_endpoint, endpoint);
7.19 - return L4_EOK;
7.20 -}
7.21 -
7.22 // vim: tabstop=4 expandtab shiftwidth=4
8.1 --- a/libfsserver/lib/files/file_pager.cc Wed Mar 09 18:13:17 2022 +0100
8.2 +++ b/libfsserver/lib/files/file_pager.cc Thu Mar 10 23:23:07 2022 +0100
8.3 @@ -120,10 +120,4 @@
8.4 return L4_EOK;
8.5 }
8.6
8.7 -long FilePager::unsubscribe(l4_cap_idx_t endpoint)
8.8 -{
8.9 - _provider->unsubscribe(_endpoint, endpoint);
8.10 - return L4_EOK;
8.11 -}
8.12 -
8.13 // vim: tabstop=4 expandtab shiftwidth=4
9.1 --- a/libfsserver/lib/generic/notification.cc Wed Mar 09 18:13:17 2022 +0100
9.2 +++ b/libfsserver/lib/generic/notification.cc Thu Mar 10 23:23:07 2022 +0100
9.3 @@ -1,7 +1,7 @@
9.4 /*
9.5 * Notification support.
9.6 *
9.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
9.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
9.9 *
9.10 * This program is free software; you can redistribute it and/or
9.11 * modify it under the terms of the GNU General Public License as
9.12 @@ -97,31 +97,6 @@
9.13 }
9.14 }
9.15
9.16 -/* Unsubscribe from an endpoint's notifications. */
9.17 -
9.18 -void NotificationSupport::unsubscribe(unsigned int endpoint, l4_cap_idx_t notifier)
9.19 -{
9.20 - std::lock_guard<std::mutex> guard(_lock);
9.21 -
9.22 - if (endpoint >= _endpoints.size())
9.23 - return;
9.24 -
9.25 - NotificationEndpoint &ep = _endpoints[endpoint];
9.26 - NotifierSet::iterator it = ep.notifiers.find(notifier);
9.27 -
9.28 - if (it != ep.notifiers.end())
9.29 - {
9.30 - ep.notifiers.erase(it);
9.31 - ipc_cap_free_um(notifier);
9.32 -
9.33 - if (ep.notifiers.empty())
9.34 - {
9.35 - ep.flags = 0;
9.36 - ep.deferred = 0;
9.37 - }
9.38 - }
9.39 -}
9.40 -
9.41 /* Notify a particular endpoint. */
9.42
9.43 void NotificationSupport::notify(unsigned int endpoint, notify_flags_t flags)
10.1 --- a/libfsserver/lib/pipes/pipe_pager.cc Wed Mar 09 18:13:17 2022 +0100
10.2 +++ b/libfsserver/lib/pipes/pipe_pager.cc Thu Mar 10 23:23:07 2022 +0100
10.3 @@ -191,10 +191,4 @@
10.4 return L4_EOK;
10.5 }
10.6
10.7 -long PipePager::unsubscribe(l4_cap_idx_t notifier)
10.8 -{
10.9 - _paging->unsubscribe(_writing ? PipePaging::WRITER : PipePaging::READER, notifier);
10.10 - return L4_EOK;
10.11 -}
10.12 -
10.13 // vim: tabstop=4 expandtab shiftwidth=4
11.1 --- a/libsystypes/idl/notification.idl Wed Mar 09 18:13:17 2022 +0100
11.2 +++ b/libsystypes/idl/notification.idl Thu Mar 10 23:23:07 2022 +0100
11.3 @@ -2,11 +2,8 @@
11.4
11.5 interface Notification
11.6 {
11.7 - /* Subscribe to events. */
11.8 + /* Subscribe to events. Unsubscribing is done via the peer returned by the
11.9 + operation. */
11.10
11.11 [opcode(23)] void subscribe(in cap notifier, in notify_flags_t flags);
11.12 -
11.13 - /* Unsubscribe from events. */
11.14 -
11.15 - [opcode(24)] void unsubscribe(in cap notifier);
11.16 };