Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ocfs2: make local header paths relative to C files

Gang He reports the failure of building fs/ocfs2/ as an external module
of the kernel installed on the system:

$ cd fs/ocfs2
$ make -C /lib/modules/`uname -r`/build M=`pwd` modules

If you want to make it work reliably, I'd recommend to remove ccflags-y
from the Makefiles, and to make header paths relative to the C files. I
think this is the correct usage of the #include "..." directive.

Link: http://lkml.kernel.org/r/20191227022950.14804-1-ghe@suse.com
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Gang He <ghe@suse.com>
Reported-by: Gang He <ghe@suse.com>
Reviewed-by: Gang He <ghe@suse.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Masahiro Yamada and committed by
Linus Torvalds
ca322fb6 5b43d645

+41 -45
-2
fs/ocfs2/dlm/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - ccflags-y := -I $(srctree)/$(src)/.. 3 - 4 2 obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o 5 3 6 4 ocfs2_dlm-objs := dlmdomain.o dlmdebug.o dlmthread.o dlmrecovery.o \
+4 -4
fs/ocfs2/dlm/dlmast.c
··· 23 23 #include <linux/spinlock.h> 24 24 25 25 26 - #include "cluster/heartbeat.h" 27 - #include "cluster/nodemanager.h" 28 - #include "cluster/tcp.h" 26 + #include "../cluster/heartbeat.h" 27 + #include "../cluster/nodemanager.h" 28 + #include "../cluster/tcp.h" 29 29 30 30 #include "dlmapi.h" 31 31 #include "dlmcommon.h" 32 32 33 33 #define MLOG_MASK_PREFIX ML_DLM 34 - #include "cluster/masklog.h" 34 + #include "../cluster/masklog.h" 35 35 36 36 static void dlm_update_lvb(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, 37 37 struct dlm_lock *lock);
+4 -4
fs/ocfs2/dlm/dlmconvert.c
··· 23 23 #include <linux/spinlock.h> 24 24 25 25 26 - #include "cluster/heartbeat.h" 27 - #include "cluster/nodemanager.h" 28 - #include "cluster/tcp.h" 26 + #include "../cluster/heartbeat.h" 27 + #include "../cluster/nodemanager.h" 28 + #include "../cluster/tcp.h" 29 29 30 30 #include "dlmapi.h" 31 31 #include "dlmcommon.h" ··· 33 33 #include "dlmconvert.h" 34 34 35 35 #define MLOG_MASK_PREFIX ML_DLM 36 - #include "cluster/masklog.h" 36 + #include "../cluster/masklog.h" 37 37 38 38 /* NOTE: __dlmconvert_master is the only function in here that 39 39 * needs a spinlock held on entry (res->spinlock) and it is the
+4 -4
fs/ocfs2/dlm/dlmdebug.c
··· 17 17 #include <linux/debugfs.h> 18 18 #include <linux/export.h> 19 19 20 - #include "cluster/heartbeat.h" 21 - #include "cluster/nodemanager.h" 22 - #include "cluster/tcp.h" 20 + #include "../cluster/heartbeat.h" 21 + #include "../cluster/nodemanager.h" 22 + #include "../cluster/tcp.h" 23 23 24 24 #include "dlmapi.h" 25 25 #include "dlmcommon.h" ··· 27 27 #include "dlmdebug.h" 28 28 29 29 #define MLOG_MASK_PREFIX ML_DLM 30 - #include "cluster/masklog.h" 30 + #include "../cluster/masklog.h" 31 31 32 32 static int stringify_lockname(const char *lockname, int locklen, char *buf, 33 33 int len);
+4 -4
fs/ocfs2/dlm/dlmdomain.c
··· 20 20 #include <linux/debugfs.h> 21 21 #include <linux/sched/signal.h> 22 22 23 - #include "cluster/heartbeat.h" 24 - #include "cluster/nodemanager.h" 25 - #include "cluster/tcp.h" 23 + #include "../cluster/heartbeat.h" 24 + #include "../cluster/nodemanager.h" 25 + #include "../cluster/tcp.h" 26 26 27 27 #include "dlmapi.h" 28 28 #include "dlmcommon.h" ··· 30 30 #include "dlmdebug.h" 31 31 32 32 #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_DOMAIN) 33 - #include "cluster/masklog.h" 33 + #include "../cluster/masklog.h" 34 34 35 35 /* 36 36 * ocfs2 node maps are array of long int, which limits to send them freely
+4 -4
fs/ocfs2/dlm/dlmlock.c
··· 25 25 #include <linux/delay.h> 26 26 27 27 28 - #include "cluster/heartbeat.h" 29 - #include "cluster/nodemanager.h" 30 - #include "cluster/tcp.h" 28 + #include "../cluster/heartbeat.h" 29 + #include "../cluster/nodemanager.h" 30 + #include "../cluster/tcp.h" 31 31 32 32 #include "dlmapi.h" 33 33 #include "dlmcommon.h" ··· 35 35 #include "dlmconvert.h" 36 36 37 37 #define MLOG_MASK_PREFIX ML_DLM 38 - #include "cluster/masklog.h" 38 + #include "../cluster/masklog.h" 39 39 40 40 static struct kmem_cache *dlm_lock_cache; 41 41
+4 -4
fs/ocfs2/dlm/dlmmaster.c
··· 25 25 #include <linux/delay.h> 26 26 27 27 28 - #include "cluster/heartbeat.h" 29 - #include "cluster/nodemanager.h" 30 - #include "cluster/tcp.h" 28 + #include "../cluster/heartbeat.h" 29 + #include "../cluster/nodemanager.h" 30 + #include "../cluster/tcp.h" 31 31 32 32 #include "dlmapi.h" 33 33 #include "dlmcommon.h" ··· 35 35 #include "dlmdebug.h" 36 36 37 37 #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_MASTER) 38 - #include "cluster/masklog.h" 38 + #include "../cluster/masklog.h" 39 39 40 40 static void dlm_mle_node_down(struct dlm_ctxt *dlm, 41 41 struct dlm_master_list_entry *mle,
+4 -4
fs/ocfs2/dlm/dlmrecovery.c
··· 26 26 #include <linux/delay.h> 27 27 28 28 29 - #include "cluster/heartbeat.h" 30 - #include "cluster/nodemanager.h" 31 - #include "cluster/tcp.h" 29 + #include "../cluster/heartbeat.h" 30 + #include "../cluster/nodemanager.h" 31 + #include "../cluster/tcp.h" 32 32 33 33 #include "dlmapi.h" 34 34 #include "dlmcommon.h" 35 35 #include "dlmdomain.h" 36 36 37 37 #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_RECOVERY) 38 - #include "cluster/masklog.h" 38 + #include "../cluster/masklog.h" 39 39 40 40 static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node); 41 41
+4 -4
fs/ocfs2/dlm/dlmthread.c
··· 25 25 #include <linux/delay.h> 26 26 27 27 28 - #include "cluster/heartbeat.h" 29 - #include "cluster/nodemanager.h" 30 - #include "cluster/tcp.h" 28 + #include "../cluster/heartbeat.h" 29 + #include "../cluster/nodemanager.h" 30 + #include "../cluster/tcp.h" 31 31 32 32 #include "dlmapi.h" 33 33 #include "dlmcommon.h" 34 34 #include "dlmdomain.h" 35 35 36 36 #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_THREAD) 37 - #include "cluster/masklog.h" 37 + #include "../cluster/masklog.h" 38 38 39 39 static int dlm_thread(void *data); 40 40 static void dlm_flush_asts(struct dlm_ctxt *dlm);
+4 -4
fs/ocfs2/dlm/dlmunlock.c
··· 23 23 #include <linux/spinlock.h> 24 24 #include <linux/delay.h> 25 25 26 - #include "cluster/heartbeat.h" 27 - #include "cluster/nodemanager.h" 28 - #include "cluster/tcp.h" 26 + #include "../cluster/heartbeat.h" 27 + #include "../cluster/nodemanager.h" 28 + #include "../cluster/tcp.h" 29 29 30 30 #include "dlmapi.h" 31 31 #include "dlmcommon.h" 32 32 33 33 #define MLOG_MASK_PREFIX ML_DLM 34 - #include "cluster/masklog.h" 34 + #include "../cluster/masklog.h" 35 35 36 36 #define DLM_UNLOCK_FREE_LOCK 0x00000001 37 37 #define DLM_UNLOCK_CALL_AST 0x00000002
-2
fs/ocfs2/dlmfs/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - ccflags-y := -I $(srctree)/$(src)/.. 3 - 4 2 obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o 5 3 6 4 ocfs2_dlmfs-objs := userdlm.o dlmfs.o
+2 -2
fs/ocfs2/dlmfs/dlmfs.c
··· 33 33 34 34 #include <linux/uaccess.h> 35 35 36 - #include "stackglue.h" 36 + #include "../stackglue.h" 37 37 #include "userdlm.h" 38 38 39 39 #define MLOG_MASK_PREFIX ML_DLMFS 40 - #include "cluster/masklog.h" 40 + #include "../cluster/masklog.h" 41 41 42 42 43 43 static const struct super_operations dlmfs_ops;
+3 -3
fs/ocfs2/dlmfs/userdlm.c
··· 21 21 #include <linux/types.h> 22 22 #include <linux/crc32.h> 23 23 24 - #include "ocfs2_lockingver.h" 25 - #include "stackglue.h" 24 + #include "../ocfs2_lockingver.h" 25 + #include "../stackglue.h" 26 26 #include "userdlm.h" 27 27 28 28 #define MLOG_MASK_PREFIX ML_DLMFS 29 - #include "cluster/masklog.h" 29 + #include "../cluster/masklog.h" 30 30 31 31 32 32 static inline struct user_lock_res *user_lksb_to_lock_res(struct ocfs2_dlm_lksb *lksb)