]> git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/include/seastar/util/internal/magic.hh
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / seastar / include / seastar / util / internal / 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 #include <linux/magic.h>
25
26 namespace seastar {
27
28 #ifndef XFS_SUPER_MAGIC
29 #define XFS_SUPER_MAGIC 0x58465342
30 #endif
31
32 #ifndef EXT2_SUPER_MAGIC
33 #define EXT2_SUPER_MAGIC 0xEF53
34 #endif
35
36 #ifndef EXT3_SUPER_MAGIC
37 #define EXT3_SUPER_MAGIC 0xEF53
38 #endif
39
40 #ifndef EXT4_SUPER_MAGIC
41 #define EXT4_SUPER_MAGIC 0xEF53
42 #endif
43
44 #ifndef NFS_SUPER_MAGIC
45 #define NFS_SUPER_MAGIC 0x6969
46 #endif
47
48 #ifndef TMPFS_MAGIC
49 #define TMPFS_MAGIC 0x01021994
50 #endif
51
52 #ifndef FUSE_SUPER_MAGIC
53 #define FUSE_SUPER_MAGIC 0x65735546
54 #endif
55
56 #ifndef BTRFS_SUPER_MAGIC
57 #define BTRFS_SUPER_MAGIC 0x9123683E
58 #endif
59
60 #ifndef HFS_SUPER_MAGIC
61 #define HFS_SUPER_MAGIC 0x4244
62 #endif
63
64 namespace internal {
65
66 class fs_magic {
67 public:
68 static constexpr unsigned long xfs = XFS_SUPER_MAGIC;
69 static constexpr unsigned long ext2 = EXT2_SUPER_MAGIC;
70 static constexpr unsigned long ext3 = EXT3_SUPER_MAGIC;
71 static constexpr unsigned long ext4 = EXT4_SUPER_MAGIC;
72 static constexpr unsigned long nfs = NFS_SUPER_MAGIC;
73 static constexpr unsigned long tmpfs = TMPFS_MAGIC;
74 static constexpr unsigned long fuse = FUSE_SUPER_MAGIC;
75 static constexpr unsigned long btrfs = BTRFS_SUPER_MAGIC;
76 static constexpr unsigned long hfs = HFS_SUPER_MAGIC;
77 };
78
79 } // internal namespace
80
81 } // seastar namespace