Allow building in a different directory.
This is useful on NixOS, where all software is stored under /nix.
As a nice side-effect, this change also reduces code duplication a little.
mpage_readpages doesn't seem to be present in version 5.8 of the kernel,
so this fixes building for it.
[ernesto.mnd.fernandez@gmail.com: fixed whitespace and added comments]
A single call to apfs_readdir() is not necessarily enough to list a
whole directory; ctx->pos tries to keep track of the last dentry found,
so that the next call can continue from the same spot.
Now that the module can create large numbers of files, it has become
obvious that this doesn't work: many files are missing from the ls
output for big directories. The bug is very simple: ctx->pos is being
incremented twice for each new record. Remove one of the increments.
This patch is a backport of commit 39e4474396cd ("apfs: fix reading of
large directories") from the development tree, so it will be dropped for
the next "release". From now on this branch can be considered stable.
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Add a short CONTRIBUTING file explaining that development is done via
email. Github should show this to users before they open issues or pull
requests.
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
When the module is built under Linux 5.0, a warning is given about the
use of 'SUBDIRS'. Replace it with 'M', as the message suggests.
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Starting with kernel version 4.10, a NULL value for the ->readlink()
method defaults to generic_readlink(), or to a similar codepath. For
older kernels this field must be set explicitly, otherwise the readlink
syscall will fail.
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Copy the code of the APFS module into its own repository, without the
rest of the kernel tree. Development will continue upstream, but the
intention is to make life easier for potential users.
To get the module to build independently, rewrite the Makefile and
add a definition for the APFS_SUPER_MAGIC macro. Since the intention is
to support a range of kernel versions, use preprocessor checks to handle
kernels without statx, without iversion, and without SB_RDONLY.
Provide a README file based on the upstream documentation, but with
additional build and mount instructions. Add a LICENSE file as well.
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>