~aleteoryx/muditaos

ref: ca75ebe4499b738d5b0e83fa07840ec013522abd muditaos/module-vfs/include/user/purefs/fs/inotify.hpp -rw-r--r-- 714 bytes
ca75ebe4 — Lucjan Bryndza [EGD-7587] Change user partition to ext4 fs 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