Commit Graph

3 Commits

Author SHA1 Message Date
Zach Brown
495358996c scoutfs: fix older kc readdir emit
When we added the kernelcompat layer around the old and new readdir
interfaces there was some confusion in the old readdir interface filldir
arguments.  We were passing in our scoutfs dent item struct pointer
instead of the filldir callback buf pointer.  This prevented readdir
from working in older kernels because filldir would immediately see a
corrupt buf and return an error.

This renames the emit compat macro arguments to make them consistent
with the other calls and readdir now provides the correct pointer to the
emit wrapper.

Signed-off-by: Zach Brown <zab@versity.com>
2020-04-21 16:28:06 -07:00
Zach Brown
ddd1a4ef5a scoutfs: support newer ->iterate readdir
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>
2020-01-15 14:57:57 -08:00
Zach Brown
2a6d209854 scoutfs: add kernelcompat files
Add files that we'll use to detect and work around incompatibilities
between kernel versions.

Signed-off-by: Zach Brown <zab@versity.com>
2020-01-15 14:57:57 -08:00