mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-04 17:52:32 +00:00
The modern upstream kernel has a ->iterate() readdir file_operattions method which takes a context and calls dir_emit(). We add some kernelcompat helpers to juggle the various function definitions, types, and arguments to support both the old ->readdir(filldir) and the new ->iterate(ctx) interfaces. Signed-off-by: Zach Brown <zab@versity.com>
37 lines
960 B
Makefile
37 lines
960 B
Makefile
#
|
|
# We try to detect the specific api incompatibilities with simple tests
|
|
# because distros regularly backport features without changing the
|
|
# version.
|
|
#
|
|
|
|
ccflags-y += -include $(src)/kernelcompat.h
|
|
|
|
#
|
|
# v3.10-rc6-21-gbb6f619b3a49
|
|
#
|
|
# _readdir changes from fop->readdir() to fop->iterate() and from
|
|
# filldir(dirent) to dir_emit(ctx).
|
|
#
|
|
ifneq (,$(shell grep 'iterate.*dir_context' include/linux/fs.h))
|
|
ccflags-y += -DKC_ITERATE_DIR_CONTEXT
|
|
endif
|
|
|
|
#
|
|
# v3.10-rc6-23-g5f99f4e79abc
|
|
#
|
|
# Helpers including dir_emit_dots() are added in the process of
|
|
# switching dcache_readdir() from fop->readdir() to fop->iterate()
|
|
#
|
|
ifneq (,$(shell grep 'dir_emit_dots' include/linux/fs.h))
|
|
ccflags-y += -DKC_DIR_EMIT_DOTS
|
|
endif
|
|
|
|
#
|
|
# RHEL extended the fop struct so to use it we have to set
|
|
# a flag to indicate that the struct is large enough and
|
|
# contains the pointer.
|
|
#
|
|
ifneq (,$(shell grep 'FMODE_KABI_ITERATE' include/linux/fs.h))
|
|
ccflags-y += -DKC_FMODE_KABI_ITERATE
|
|
endif
|