Skip to content

Commit 6be15dc

Browse files
committed
basic: Remove assertions from missing_fs.h
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.
1 parent 54f6bc1 commit 6be15dc

File tree

5 files changed

+5
-42
lines changed

5 files changed

+5
-42
lines changed

src/basic/missing_fs.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,8 @@
11
/* SPDX-License-Identifier: LGPL-2.1-or-later */
22
#pragma once
33

4-
/* temporary undef definitions in bits/uio-ext.h, which is included by sys/uio.h */
5-
#include <sys/uio.h>
6-
7-
#define __RWF_HIPRI_SAVED__ RWF_HIPRI
8-
#undef RWF_HIPRI
9-
#define __RWF_DSYNC_SAVED__ RWF_DSYNC
10-
#undef RWF_DSYNC
11-
#define __RWF_SYNC_SAVED__ RWF_SYNC
12-
#undef RWF_SYNC
13-
#define __RWF_NOWAIT_SAVED__ RWF_NOWAIT
14-
#undef RWF_NOWAIT
15-
#define __RWF_APPEND_SAVED__ RWF_APPEND
16-
#undef RWF_APPEND
17-
#define __RWF_NOAPPEND_SAVED__ RWF_NOAPPEND
18-
#undef RWF_NOAPPEND
19-
#if defined(RWF_ATOMIC)
20-
#define __RWF_ATOMIC_SAVED__ RWF_ATOMIC
21-
#undef RWF_ATOMIC
22-
#else
23-
#define __RWF_ATOMIC_SAVED__ 0x00000040
24-
#endif
25-
#if defined(RWF_DONTCACHE)
26-
#define __RWF_DONTCACHE_SAVED__ RWF_DONTCACHE
27-
#undef RWF_DONTCACHE
28-
#else
29-
#define __RWF_DONTCACHE_SAVED__ 0x00000080
30-
#endif
31-
32-
#include <linux/btrfs.h>
33-
#include <linux/btrfs_tree.h>
344
#include <linux/fs.h>
355

36-
#include "macro.h"
37-
38-
/* check RWF_xyz are redefined by linux/fs.h */
39-
assert_cc(RWF_HIPRI == __RWF_HIPRI_SAVED__);
40-
assert_cc(RWF_DSYNC == __RWF_DSYNC_SAVED__);
41-
assert_cc(RWF_SYNC == __RWF_SYNC_SAVED__);
42-
assert_cc(RWF_NOWAIT == __RWF_NOWAIT_SAVED__);
43-
assert_cc(RWF_APPEND == __RWF_APPEND_SAVED__);
44-
assert_cc(RWF_NOAPPEND == __RWF_NOAPPEND_SAVED__);
45-
assert_cc(RWF_ATOMIC == __RWF_ATOMIC_SAVED__);
46-
assert_cc(RWF_DONTCACHE == __RWF_DONTCACHE_SAVED__);
47-
486
/* Not exposed yet. Defined at fs/ext4/ext4.h */
497
#ifndef EXT4_IOC_RESIZE_FS
508
#define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)

src/shared/btrfs-util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <errno.h>
44
#include <fcntl.h>
55
#include <inttypes.h>
6+
#include <linux/btrfs.h>
7+
#include <linux/btrfs_tree.h>
68
#include <linux/loop.h>
79
#include <linux/magic.h>
810
#include <stddef.h>

src/shared/copy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <errno.h>
44
#include <fcntl.h>
5+
#include <linux/btrfs.h>
56
#include <stddef.h>
67
#include <stdio.h>
78
#include <stdlib.h>

src/shared/resize-fs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* SPDX-License-Identifier: LGPL-2.1-or-later */
22

3+
#include <linux/btrfs.h>
34
#include <linux/magic.h>
45
#include <sys/ioctl.h>
56
#include <sys/vfs.h>

src/udev/udev-builtin-btrfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* SPDX-License-Identifier: LGPL-2.1-or-later */
22

33
#include <fcntl.h>
4+
#include <linux/btrfs.h>
45
#include <stdlib.h>
56
#include <sys/ioctl.h>
67

0 commit comments

Comments
 (0)