diff options
| author | Karel Zak <kzak@redhat.com> | 2025-07-16 13:52:07 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2025-08-06 15:03:29 +0200 |
| commit | 8c76b852717fc35fc07b4805239cf7b51f3d39d9 (patch) | |
| tree | 9655e63d63793e54d04053f9001c0b208b231a55 /libmount/src/mountP.h | |
| parent | f9c62adb72da799d230acdfce1fd5369e127c68f (diff) | |
| download | util-linux-8c76b852717fc35fc07b4805239cf7b51f3d39d9.tar.gz | |
libmount: add mnt_fs_is_{moved,attached,detached} functions
Let's use these simple functions to report what the last operation or
status detected by the library means to the filesystem. It will be
used by the fanotify monitor as well.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/mountP.h')
| -rw-r--r-- | libmount/src/mountP.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 7c504f95ce..8dc31acad9 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -286,6 +286,26 @@ struct libmnt_fs { #define MNT_FS_KERNEL (1 << 4) /* data from /proc/{mounts,self/mountinfo} */ #define MNT_FS_MERGED (1 << 5) /* already merged data from /run/mount/utab */ +#define MNT_FS_STATUS_ATTACH (1 << 6) +#define MNT_FS_STATUS_DETACH (1 << 7) + +static inline void mnt_fs_mark_attached(struct libmnt_fs *fs) +{ + fs->flags &= ~MNT_FS_STATUS_DETACH; + fs->flags |= MNT_FS_STATUS_ATTACH; +} + +static inline void mnt_fs_mark_detached(struct libmnt_fs *fs) +{ + fs->flags &= ~MNT_FS_STATUS_ATTACH; + fs->flags |= MNT_FS_STATUS_DETACH; +} + +static inline void mnt_fs_mark_moved(struct libmnt_fs *fs) +{ + fs->flags |= MNT_FS_STATUS_ATTACH | MNT_FS_STATUS_DETACH; +} + #ifdef HAVE_STATMOUNT_API # define mnt_fs_try_statmount(FS, MEMBER, FLAGS) __extension__ ({ \ if (!(FS)->MEMBER \ |
