]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: Remove assertions from missing_fs.h
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 29 Apr 2025 13:46:48 +0000 (15:46 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 30 Apr 2025 05:50:10 +0000 (07:50 +0200)
These assertions impose an include order between <linux/fs.h> and
"missing_fs.h", specifically <linux/fs.h> can't be included before
"missing_fs.h". This makes automated include refactoring very painful,
so let's get rid of these assertions and instead assume that linux/fs.h
does the right thing.

src/basic/missing_fs.h
src/shared/btrfs-util.c
src/shared/copy.c
src/shared/resize-fs.c
src/udev/udev-builtin-btrfs.c

index c3b2746b07a9485d2a9430d2dc0d0b4b8bed0d3c..1e2f07e55f7955a326c98fc19e316f3ea04b347a 100644 (file)
@@ -1,50 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-/* temporary undef definitions in bits/uio-ext.h, which is included by sys/uio.h */
-#include <sys/uio.h>
-
-#define __RWF_HIPRI_SAVED__     RWF_HIPRI
-#undef RWF_HIPRI
-#define __RWF_DSYNC_SAVED__     RWF_DSYNC
-#undef RWF_DSYNC
-#define __RWF_SYNC_SAVED__      RWF_SYNC
-#undef RWF_SYNC
-#define __RWF_NOWAIT_SAVED__    RWF_NOWAIT
-#undef RWF_NOWAIT
-#define __RWF_APPEND_SAVED__    RWF_APPEND
-#undef RWF_APPEND
-#define __RWF_NOAPPEND_SAVED__  RWF_NOAPPEND
-#undef RWF_NOAPPEND
-#if defined(RWF_ATOMIC)
-#define __RWF_ATOMIC_SAVED__    RWF_ATOMIC
-#undef RWF_ATOMIC
-#else
-#define __RWF_ATOMIC_SAVED__    0x00000040
-#endif
-#if defined(RWF_DONTCACHE)
-#define __RWF_DONTCACHE_SAVED__ RWF_DONTCACHE
-#undef RWF_DONTCACHE
-#else
-#define __RWF_DONTCACHE_SAVED__ 0x00000080
-#endif
-
-#include <linux/btrfs.h>
-#include <linux/btrfs_tree.h>
 #include <linux/fs.h>
 
-#include "macro.h"
-
-/* check RWF_xyz are redefined by linux/fs.h */
-assert_cc(RWF_HIPRI     == __RWF_HIPRI_SAVED__);
-assert_cc(RWF_DSYNC     == __RWF_DSYNC_SAVED__);
-assert_cc(RWF_SYNC      == __RWF_SYNC_SAVED__);
-assert_cc(RWF_NOWAIT    == __RWF_NOWAIT_SAVED__);
-assert_cc(RWF_APPEND    == __RWF_APPEND_SAVED__);
-assert_cc(RWF_NOAPPEND  == __RWF_NOAPPEND_SAVED__);
-assert_cc(RWF_ATOMIC    == __RWF_ATOMIC_SAVED__);
-assert_cc(RWF_DONTCACHE == __RWF_DONTCACHE_SAVED__);
-
 /* Not exposed yet. Defined at fs/ext4/ext4.h */
 #ifndef EXT4_IOC_RESIZE_FS
 #define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
index 713ecb4eb57c7b927538b68685112fa0e9eec127..d296ac682caa0d8f4ac70b113df7e35e3cf26ebc 100644 (file)
@@ -3,6 +3,8 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <inttypes.h>
+#include <linux/btrfs.h>
+#include <linux/btrfs_tree.h>
 #include <linux/loop.h>
 #include <linux/magic.h>
 #include <stddef.h>
index c662853ac86bfe72723b009292a35a1b6c74bf22..4288bae1ceaa8a9ba37a8087f58a5ca7a76752cd 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <linux/btrfs.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
index b913aedef3692c474d084757aa8b0eeb1ef6e1e1..0f28869ea06acae4b77741e06529b09f3dda4fe7 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <linux/btrfs.h>
 #include <linux/magic.h>
 #include <sys/ioctl.h>
 #include <sys/vfs.h>
index a1238f1e1b3b873c57ca24342c04536bc7222dc6..118b934b76793b5691900fbdef2f3b03b9c5960a 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <fcntl.h>
+#include <linux/btrfs.h>
 #include <stdlib.h>
 #include <sys/ioctl.h>