1.1 --- a/libfsclient/lib/src/notifier.cc Wed Mar 09 18:13:17 2022 +0100
1.2 +++ b/libfsclient/lib/src/notifier.cc Thu Mar 10 23:23:07 2022 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * File event notification support.
1.6 *
1.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -221,14 +221,7 @@
1.13 if (state.is_null())
1.14 return -L4_EINVAL;
1.15
1.16 - client_Notification notify(file->ref);
1.17 -
1.18 - long err = notify.unsubscribe(state.endpoint);
1.19 -
1.20 - if (err)
1.21 - return err;
1.22 -
1.23 - _unsubscribe(state, file);
1.24 + _state.erase(file);
1.25
1.26 /* Remove the lock for updating file state. */
1.27
1.28 @@ -237,21 +230,6 @@
1.29 return L4_EOK;
1.30 }
1.31
1.32 -/* Remove file notification state from the notifier. */
1.33 -
1.34 -void FileNotifier::_unsubscribe(FileNotificationState &state, file_t *file)
1.35 -{
1.36 - /* Acquire the lock for updating file state. */
1.37 -
1.38 - std::mutex &file_lock = _file_locks[file];
1.39 - std::unique_lock<std::mutex> file_guard(file_lock);
1.40 -
1.41 - /* Remove file-specific state. */
1.42 -
1.43 - ipc_cap_free_um(state.endpoint);
1.44 - _state.erase(file);
1.45 -}
1.46 -
1.47
1.48
1.49 /* Handle a notification event for a file. Ideally, this would be invoked by the