Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
magic.hh
1/*
2 * This file is open source software, licensed to you under the terms
3 * of the Apache License, Version 2.0 (the "License"). See the NOTICE file
4 * distributed with this work for additional information regarding copyright
5 * ownership. You may not use this file except in compliance with the License.
6 *
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
16 * under the License.
17 */
18/*
19 * Copyright (C) 2022 ScyllaDB.
20 */
21
22#pragma once
23
24#ifndef SEASTAR_MODULE
25#include <linux/magic.h>
26#endif
27
28namespace seastar {
29
30#ifndef XFS_SUPER_MAGIC
31#define XFS_SUPER_MAGIC 0x58465342
32#endif
33
34#ifndef EXT2_SUPER_MAGIC
35#define EXT2_SUPER_MAGIC 0xEF53
36#endif
37
38#ifndef EXT3_SUPER_MAGIC
39#define EXT3_SUPER_MAGIC 0xEF53
40#endif
41
42#ifndef EXT4_SUPER_MAGIC
43#define EXT4_SUPER_MAGIC 0xEF53
44#endif
45
46#ifndef NFS_SUPER_MAGIC
47#define NFS_SUPER_MAGIC 0x6969
48#endif
49
50#ifndef TMPFS_MAGIC
51#define TMPFS_MAGIC 0x01021994
52#endif
53
54#ifndef FUSE_SUPER_MAGIC
55#define FUSE_SUPER_MAGIC 0x65735546
56#endif
57
58#ifndef BTRFS_SUPER_MAGIC
59#define BTRFS_SUPER_MAGIC 0x9123683E
60#endif
61
62#ifndef HFS_SUPER_MAGIC
63#define HFS_SUPER_MAGIC 0x4244
64#endif
65
66namespace internal {
67
68class fs_magic {
69public:
70 static constexpr unsigned long xfs = XFS_SUPER_MAGIC;
71 static constexpr unsigned long ext2 = EXT2_SUPER_MAGIC;
72 static constexpr unsigned long ext3 = EXT3_SUPER_MAGIC;
73 static constexpr unsigned long ext4 = EXT4_SUPER_MAGIC;
74 static constexpr unsigned long nfs = NFS_SUPER_MAGIC;
75 static constexpr unsigned long tmpfs = TMPFS_MAGIC;
76 static constexpr unsigned long fuse = FUSE_SUPER_MAGIC;
77 static constexpr unsigned long btrfs = BTRFS_SUPER_MAGIC;
78 static constexpr unsigned long hfs = HFS_SUPER_MAGIC;
79};
80
81} // internal namespace
82
83} // seastar namespace
Seastar API namespace.
Definition: abort_on_ebadf.hh:26