~aleteoryx/muditaos

ref: 1a66e73b78c6535829ee6ab180ff5e5c5892e343 muditaos/module-vfs/include/user/purefs/fs/inotify.hpp -rw-r--r-- 714 bytes
1a66e73b — Wojtek Rzepecki [BH-1167] USB async receive 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <memory>
#include <purefs/vfs_subsystem.hpp>
#include <purefs/fs/fsnotify.hpp>

namespace purefs::fs
{
    /** Create inotify class which owns the notifier interface
     * @param[in] svc Owner of the service
     * @return Inotify object shared ptr or errno if nullptr
     */
    inline auto inotify_create(std::shared_ptr<sys::Service> svc) -> std::shared_ptr<inotify>
    {
        const auto vfs = subsystem::vfs_core();
        if (!vfs) {
            return nullptr;
        }
        return vfs->inotify_create(svc);
    }
} // namespace purefs::fs